As pointed out in the question Keeping the InfoWindow in view when zooming map in, there appears to be a change with the v3 API that effects the default behavior when InfoWindows are visible.
Google’s default behavior on their own map site (http://goo.gl/maps/8ymit) accounts for this by handling zooming differently. It appears that the “center” of the zoom is set to the marker position if the currently selected marker is visible within the viewport; otherwise it defaults to the center of the map (or the location of the mouse in cases of double-click or mouse wheel scrolling).
How can I duplicate the behavior of the Google Maps site? I know how to get the location of the currently selected marker and to tell if it is visible. However, I have not had any luck setting the “center” of the zoom activity separately from setting the center of the map.
The solution involves a lot of math. Here’s the general outline:
Resources