[OpenLayers-Users] KML <heading> tag

Andreas Hocevar ahocevar at opengeo.org
Sat Oct 29 06:37:59 EDT 2011


Hi,

for KML tracks, your features get populated with a heading attribute when you configure the KML format with

extractTracks: true

You can then use that attribute for a dynamic symbolizer in your StyleMap, e.g. with

rotation: "${heading}",

You may want to use the http://openlayers.org/dev/examples/kml-track.html example as a starting point. It has extractTacks option set to true already, and you only have to add the above rotation property to the StyleMap's "default" Style definition.

Andreas.

On Oct 28, 2011, at 15:17 , Tobias Reinicke wrote:

> Hello All,
> 
> I was wondering if it is a known limitation of OL that it doesn't read
> the <heading> tag in a kml file...
> 
> If you go here
> http://openlayers.org/dev/examples/vector-formats.html
> and select kml in the dropdown, and then paste the following:
> <kml xmlns="http://www.opengis.net/kml/2.2"
> xmlns:gx="http://www.google.com/kml/ext/2.2"
> xmlns:kml="http://www.opengis.net/kml/2.2"
> xmlns:atom="http://www.w3.org/2005/Atom"><Document><name>Aircraft
> Tracking</name><Placemark
> id="placemark400A52"><name>EZY2016</name><description>something</description><Style
> id="sn_aircraft"><IconStyle><scale>0.8</scale><heading>26</heading><Icon><href>http://defra.eodata.co.uk/images/icons/aircraft_orange.png</href></Icon></IconStyle></Style><Point><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><coordinates>-0.21255,51.61368,4900</coordinates></Point></Placemark>
> 
> I would have thought that the icon should be rotated according to the
> <heading> tag.
> 
> Any thoughts would be much appreciated.
> 
> Regards,
> 
> Toby
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list