[OpenLayers-Users] getting name placemark from a kml-file

The_Zebra pfischer at zebra.com
Wed May 19 04:20:39 EDT 2010


hallo,

i want to display on map some icons, written in a kml file. i do this with
the following statement:

  markers = new OpenLayers.Layer.GML("KML", "unit.kml",
               {format: OpenLayers.Format.KML,
                formatOptions: {
                  extractStyles: true,
                  extractAttributes: true,}
               });
   map.addLayer(markers);

this runs great, but now my problem: in the kml file is also the name of the
icon i am displaying:

 <Placemark>
         <name>Tractor1</name>
         <visibility>1</visibility>
         <open>0</open>
         <styleUrl>#SmallTractor</styleUrl>
         <Point>
            <coordinates>4.486325, 50.90313777777778</coordinates>
         </Point>
 </Placemark>

i want to open/show a label or popup by clicking on the icon in the map.
this label should show the name which is written in the kml file, in this
case the "Tractor1".

How can i realise that? Please Help

Thanks!

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/getting-name-placemark-from-a-kml-file-tp5073940p5073940.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list