I think there is an easier way to do it, but that could just be me:
function initialize() {
....
all your stuff here to create the Map Markers and Windows
...
for(i=0;i< locations.length; i++){
placeInfoWindow(locations[i], infoWindow[i]);
}
}
// this function will take a create the current Marker and InfoWindow
that you are looping through above
function placeInfoWindow(marker, thisWindow) {
google.maps.event.addListener(marker, 'click', function()
{
thisWindow.open(map,marker);
});
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.