0x4a6f4672
0x4a6f4672

Reputation: 28245

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.

Upvotes: 12

Views: 4063

Answers (1)

danhardman
danhardman

Reputation: 621

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.

Upvotes: 5

Related Questions