Hello.
I want to add an infowindow for each marker shown on a map, but with
the same code if I click on a marker the infowindow appears only on
the last marker created.
Here the code:
for (i=0; i<points.length; i++)
{
var latlng = new google.maps.LatLng(points[i].latitude,
points[i].longitude);
var marker = new google.maps.Marker({
position: latlng,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: points[i].text
});
google.maps.event.addListener(marker, 'click',
function() {
infowindow.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.