Type Here to Get Search Results !

What is difference between setCenter and panTo google maps.

Google map's panTo and getCenter is both for center the map position by given latitude and longitude.

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.
map.panTo(new google.maps.LatLng(latitude, longitude));

setCenter

  • Change the center of the map to the given LatLng.
map.setCenter(new google.maps.LatLng(latitude, longitude));


where
var map = new google.maps.Map(element, mapOptions);

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

bogger post ad 1

Below Post Ad

bogger post ad 2

ezoic

Ads Section