Found a solution to avoid shifting of the center point of hidden maps:
// Trigger 'resize' event of all maps
// when the browser window is resized
window.onresize = function() {
var allmaps = [map1, map2, map3];
for (var i = 0, m; m = allmaps[i]; i++) {
var center = m.getCenter();
google.maps.event.trigger(m, "resize");
m.setCenter(center);
}
};
And again: To trigger only the 'resize' event would not suffice. It is
also necessary to correct the map's center point.
Though I don't know the reason why the center will be shifted when the
map is hidden, and will not be shifted when the map is visible.
--
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.