Link: http://tinyurl.com/prjcop

I'm trying to get multiple markers loaded from an xml. When you click
on a marker, it should forward to another page. It works, but it only
picks the id (which is specified in the xml) of the last record. How
can i fix this? Is used the code below How can i fix this.

GDownloadUrl("/mediators/xml.php", function(data, responseCode) {
    var xml = GXml.parse(data);
        map.setCenter(new GLatLng(52.1326330, 5.2912660), 6,
G_SATELLITE_MAP);
    var markers = xml.documentElement.getElementsByTagName("marker");
    for (var i = 0; i < markers.length; i++) {
      var point = new GLatLng(parseFloat(markers[i].getAttribute
("lat")),
                              parseFloat(markers[i].getAttribute
("lng")));

          var id = markers[i].getAttribute("id");
                  var marker = new GMarker(point,icon);
                  map.addOverlay(marker);

                   GEvent.addListener(marker, "click", function() {

                marker.openInfoWindowHtml(window.location="http://
www.fininter.nl/index.php?p=details&id=" + id);
        });
    }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to