I had the same problem yesterday and found out that if I just moved
the "addListener" part of the code to its own function it will work.
In other words, instead of:

   google.maps.event.addListener(marker, "click", function(e) {
                        var infoBox = new InfoBox({latlng:
marker.getPosition(), map: map,
title: marker.title, content: marker.content});
                });

do:

function attachToMark(marker,content) {
   google.maps.event.addListener(marker, "click", function(e) {
                        var infoBox = new InfoBox({latlng:
marker.getPosition(), map: map,
title: marker.title, content: marker.content});
                });

}

and call that function inside your for-loop.

-- 
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 google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to