On Apr 24, 9:20 am, JohnH <[email protected]> wrote:
> I'm making an API V3 map which contains multiple markers,
> and am having no luck finding V3 documentation on how to close the old
> balloon-tip when a new marker is clicked and new balloon appears (in
> other words, so that only one balloon is ever displayed).
you will need to create only one InfoWindow, and set the content
before opening it, something like this:
var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker1, 'click', function() {
infowindow.setContent('Hello Mary');
infowindow.open(map, marker1);
});
google.maps.event.addListener(marker2, 'click', function() {
infowindow.setContent('Hello Fred');
infowindow.open(map, marker2);
});
--
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.