function changePan(){
var latlngbounds = new GLatLngBounds( );
latlngbounds.extend(new GLatLng(39.907,116.387));
latlngbounds.extend(new GLatLng(39.935,116.407));
latlngbounds.extend(new GLatLng(39.944,116.432));
latlngbounds.extend(new GLatLng(39.924,116.427));
map.setCenter( latlngbounds.getCenter( ), map.getBoundsZoomLevel( latlngbounds ) );
}
google map 根据marker的多少设置中心点和缩放比例
最新推荐文章于 2024-04-22 14:45:01 发布
本文介绍了一种通过定义经纬度范围来实现地图平移的方法。该方法使用了四个不同的经纬度坐标来设置地图的边界,并将地图中心定位到这些坐标的平均位置。此功能适用于需要在特定地理区域内进行地图导航的应用场景。

1504

被折叠的 条评论
为什么被折叠?



