Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google MAP API v3: Move center between two locs

How can I move the camera from one loc to another loc ? I have checked the API but I couldn't find what I want beside the setCenter method which directly sets the center to the given location but I want to a smooth transtition, not an instant center change.

like image 473
Hellnar Avatar asked Jul 06 '11 10:07

Hellnar


1 Answers

http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

Method panTo.

Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.

like image 77
katspaugh Avatar answered Oct 09 '22 12:10

katspaugh