<script type="text/javascript">
var map = null;
var geocoder = null;
// A function to create the marker and set up the event window
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
function initialize() {
if (GBrowserIsCompatible()) {
geocoder = new GClientGeocoder();
var map = new GMap2(document.getElementById
("map_canvas"));
map.setCenter(new GLatLng(34, 0), 1);
GDownloadUrl("data2.xml", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName
("marker");
for (var i = 0; i < markers.length; i++) {
var address = markers[i].getAttribute("address");
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (point) {
map.setCenter(new GLatLng(34, 0), 1);
var marker = new GMarker(point);
map.addOverlay(new GMarker(point));
var marker = createMarker(point,address);
map.addOverlay(marker);
}
}
);
}
}
});
}
}
</script>
Hi all,
the above is the code. when I try this in google map. the pointers
are working fine. But when I click on the pointer, the address is
always the same..it does not show the correct location address, but
the address not found. It just stores the address not found, the first
one and shows it for all the pointers. Not sure, how to fix this. Any
help or direction is greatly appreciated.
Thanks,
naveen
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---