Hi Shadin,<br><br>Interesting timing - I just finally got on this list, and this is the first message I received, and I just was working on just that in my project.....<br><br>Here's what I've done:<br><br>In my PHP code I'm creating a KML file that I'll be loading, and I do the following:<br>
<br> ## Divide the bearing by 22 to get a value from 0-15 for icons<br> $p->setStyleUrl('#track-' . round($this->bearing[$c] / 22)); <br><br>This sets the style in my KML to reference "track-4.png" (or any other number from 0-15)<br>
<br>In my style declarations in the KML I have:<br><br><Style id="track-0"><br><IconStyle><br><hotSpot x="19" y="0" xunits="pixels" yunits="pixels" /><br>
<color>8800aa00</color><br><colorMode>normal</colorMode><br><scale>1</scale><br><Icon><br><href>img/KMLIcons/track-0.png</href><br></Icon><br></IconStyle><br>
</Style><br><Style id="track-1"><br><IconStyle><br><hotSpot x="19" y="0" xunits="pixels" yunits="pixels" /><br><color>8800aa00</color><br>
<colorMode>normal</colorMode><br><scale>1</scale><br><Icon><br><href>img/KMLIcons/track-1.png</href><br></Icon><br></IconStyle><br></Style><br><br>Also there is "track-none.png" for a non-directional marker.<br>
<br>I just remembered that the hotspot is wrong there - change it so x and y are 0.5, and use "fraction" for the units to have it align over the centre of the location.<br><br>If you want the icons, there's a zip file with them at <a href="http://vint.ca/dumps/directionalKMLIcons.zip">http://vint.ca/dumps/directionalKMLIcons.zip</a><br>
<br>Cheers<br><br>Paul<br><br><br><div class="gmail_quote">On Wed, Jan 25, 2012 at 2:13 AM, Marc Jansen <span dir="ltr"><<a href="mailto:jansen@terrestris.de" target="_blank">jansen@terrestris.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
Hi Shadin,<br>
<br>
Have a look at
<a href="http://openlayers-buch.de/beispiele/chapter-10/layer-lineDirection.html" target="_blank">http://openlayers-buch.de/beispiele/chapter-10/layer-lineDirection.html</a>
(which is working on an older version of OpenLayers), which might be
of help. This is the source code:
<a href="http://openlayers-buch.de/beispiele/chapter-10/OpenLayers.Layer.LineDirections.js" target="_blank">http://openlayers-buch.de/beispiele/chapter-10/OpenLayers.Layer.LineDirections.js</a>.<br>
<br>
Best regards,<br>
Marc<br>
<br>
<br>
On 21.01.2012 15:41, Shadin wrote:
<blockquote type="cite"><b>
I am wondering about how to replace my features with arrows
depending on its direction in the DB. the direction shown as
numbers from 0 - 360
I have found this but still not sure
has anyone ever tried something similar ?
</b>
<a href="http://blog.geoserver.org/2009/04/02/follow-the-arrows/" target="_blank">http://blog.geoserver.org/2009/04/02/follow-the-arrows/</a> <br>
<hr align="left" width="300">
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Follow-the-arrows-tp7211128p7211128.html" target="_blank">Follow
the arrows</a><br>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html" target="_blank">OpenLayers
Users mailing list archive</a> at Nabble.com.<br>
<pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br>