I have the following code:
for (var i=1;arrayName[i]!=null;i++){
myLat = arrayLat[i];
myLng = arrayLng[i];
var options = {
// title: arrayName[i]
};
//alert('time: '+i);
// Add marker and show overlay
markerArr[i] = new GMarker(new GLatLng
(myLat,myLng), options);
markerArr[i].show();
// markerArrArr[i] = markerArr[i];
GEvent.addListener(markerArr[i], 'mouseover',
function() {
alert('value i: '+i)
markerArr[i].openInfoWindow('I\'m '+name);
});
map.addOverlay(markerArr[i]);
}
However, no matter which marker I mouse over, it will show me the same
value from the last array.
Any idea?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---