当前位置: 代码迷 >> Web前端 >> google 地图 根据marker的多少设置中心点和缩放比例
  详细解决方案

google 地图 根据marker的多少设置中心点和缩放比例

热度:81   发布时间:2012-08-30 09:55:54.0
google map 根据marker的多少设置中心点和缩放比例
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 ) );

}
1 楼 sangdiyage 2012-01-13  
这个map api v3的吗?
2 楼 yi_17328214 2012-02-15  
这个是v2的,
V3也有这个东西的。
  相关解决方案