Just started converting our maps from V2 of the API to v3.
Got one issue so far in that when an InfoWindow is open, and the map is zoomed in, the InfoWindow will move off the map and eventually not be visible, this is different behaviour than in V2. In V2 the InfoWindow remains in view all the time.
V2 map: http://www.stroud.gov.uk/docs/housing/tenant_map_v2.asp
V3 map: http://www.stroud.gov.uk/docs/housing/tenant_map_v3.asp
Simply click on any marker to open it's InfoWindow, then zoom the map in with the normal zoom controls.
Is there a way to keep the behaviour as in the V2 map?
Thanks, Mike
I've come up with a solution that works. URL as above but use tenant_map.asp
var currentInfoWindow = null; // new global scope variable to hold current open infoWindow
In the google.maps.event.addListener(newMarker, "click" function I've added:
currentInfoWindow = this;
Add a zoom_changed listener:
google.maps.event.addListener(theMap, "zoom_changed", function () {
if (currentInfoWindow != null) {
infoWindow.open(theMap, currentInfoWindow);
}
});
and an infoWindow closeclick listener:
google.maps.event.addListener(infoWindow, "closeclick", function () {
currentInfoWindow = null;
});
Seems to work ok, do get a little bit of panning when zooming, but this has been the only thing that I've got to work so far.
It doesn't look as good as the V2 map, so if anyone else has a better solution, please post.