There is a sample on Google Maps API documentation which should be used to read XML files. This is a receipt of code taken from there:
var name = markers[i].getAttribute("name");
where in the xml file you would find it here:
<marker name="mymarker"/>
The variable 'name' should have the value 'mymarker', but for some reasons (browser incompatibility mostly) it didn't work for me. My solution was to reconstruct the XML file and the XML line looks like this:
<marker>
<name>mymarker</name>
</marker>
Reading the value :
var name = markers[i].childNodes[0].nodeValue;
Here is the working solution for reading xml files.
Saturday, March 6, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment