I'm currently trying to get this method to work, with no luck.  I
first do a fitBounds on my map, and then on select would like to pan/
zoom to the specificed object.  fitBounds() works for that but
produces a noticeable jump.  For fitBounds I'm feeding in the corner
points into a LatLngBounds object.  I'm guessing that panToBounds is
similarly used or is it different?

Here's the code I'm using, where env[] is an array containing the
corner points:

bounds = new google.maps.LatLngBounds();
bounds.extend(env[0]);
bounds.extend(env[1]);


map.fitBounds(bounds); //works
map.panToBounds(bounds); //doesn't work


On Dec 7, 11:23 am, Esa <[email protected]> wrote:
> I can see panToBounds() method of Map().
>
> It seems to pan the map to bring given LatLngBounds into viewport. It
> even avoids control elements. That is neat.
>
> If the LatLngBounds does not fit into viewport, it seems to set
> NorthWest of the LatLngBounds to NorthWest of the viewport.

--

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.


Reply via email to