Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between panTo and setCenter

Where is the difference between the panTo and setCenter functions in the Google Maps API V3? Both seem to change the center of the map to the given point.

like image 559
0x4a6f4672 Avatar asked Jan 08 '14 17:01

0x4a6f4672


1 Answers

According to the reference:

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.

setCenter simply changes the center of the map.

like image 136
danhardman Avatar answered Nov 10 '22 04:11

danhardman