I've done something similar to keep just one infoWindow open. I initialize a var like this var currentInfoWindow = null;
then on every marker click event I do something like this: var infowindow = new google.maps.InfoWindow({ content: "your content here" }); google.maps.event.addListener(marker, 'click', function() { if (currentInfoWindow != null) { currentInfoWindow.close(); } infowindow.open(map, marker); currentInfoWindow = infowindow; }); On Jun 18, 11:24 am, "geocode...@gmail.com" <geocode...@gmail.com> wrote: > On Jun 18, 8:02 am, Andy Newby <andy.ne...@gmail.com> wrote: > > > Hi, > > > I've almost finished converting our map from the v2 API to v3: > > >http://www.chambresdhotesfrancedev.com/Europe/ > > > I have 1 last thing I need to do, which I can't seem to work out. When you > > click on an info window at the moment, it will stay open when you move the > > map (and when an InfoWindow is open and you move the map around, it will > > auto-center again on that marker) > > I don't see that behavior in Chrome. > > > > > Is there a way to make it so the window is auto-closed when you move the > > map? > > You can write code to close it on the center_changed or bounds_changed > events. > > -- Larry > > > > > > > > > > > TIA > > > Andy -- 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-v3@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.