google-maps - panTo 和 setCenter 的区别

标签 google-maps google-maps-api-3

panTo的区别在哪里和 setCenter Google Maps API V3 中的函数?两者似乎都将 map 中心更改为给定点。

最佳答案

根据reference :

泛到:

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 只是改变 map 的中心。

关于google-maps - panTo 和 setCenter 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21002096/

相关文章:

javascript - Google Maps API fitBounds 导致 0,0 位置

javascript - 禁止点击标记

iphone - 如何在 iPhone 中滚动 map 时跟踪 map 区域

javascript - 监听复选框并在谷歌地图上显示/隐藏圆形形状(AngularJS)

javascript - 在元素列表 json 之后缺少 ]

javascript - 附近地点 Google map Places API

javascript - 在谷歌地图多边形数组上设置点击优先级

android - 使用 SupportMapFragment getMap() 时得到 java.lang.NullPointerException;在 fragment 中

google-maps - Openstreetmap 数据与 OpenLayers 对比谷歌地图?

javascript - 从多边形数组中删除多边形子集