2010-05-14 75 views

回答

4

找到了一种方法做的setBounds这里:http://www.mymapofjapan.com/blog/setting-size-and-zoom-level-of-maps/

var bounds = new GLatLngBounds; 
bounds.extend(new GLatLng(South, West)); 
bounds.extend(new GLatLng(North, East)); 
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds)); 

因为谷歌地图具有独立的变焦水平,你可能就无法将其设置为正是你想要的边界,所以你可能需要调用map.getBounds();之后向用户展示他们正在查看的实际边界。

相关问题