Hello all, I saw an email last week concerning a new user that moved from the Google Maps API to OpenLayers. I have also used Google, and I was able return info from a kml file to an info box. However, I am terribly lost trying to do this using OpenLayers. Does anyone have advice on how to extract the <name> and/or <description> from a kml file to an alert box?
var kmlLayer = new OpenLayers.Layer.GML("KML", "KML/kml1.kml", { format: OpenLayers.Format.KML, projection: map.displayProjection, formatOptions: { extractStyles: true, extractAttributes: true } }); map.addLayer(kmlLayer); <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>placemark</name> <description>Location X</description> <Point> <coordinates>-74,43,0</coordinates> </Point> </Placemark> </kml> Thanks again, Ed
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users