我正在使用百度创建一个交互式地图。有谁知道如何在百度/自动缩放中使用绑定?百度地图有自动缩放功能吗?我在他们的文件里找不到任何东西。也许有,但它是中文的,我看不懂中文:
百度文档:http://developer.baidu.com/map/index.php?title=jspopular
我也找到了这个,但我找不到任何关于如何使用它的说明。http://developer.baidu.com/map/reference/index.php?title=Class:%E5%9F%BA%E7%A1%80%E7%B1%BB/Bounds
提前使用THanks!
发布于 2015-07-21 20:33:37
找到解决方案了!将标记点存储到数组中,并使用getViewport()方法获得计算出的中心和缩放。希望这对任何人都有帮助。
map_center = map.getViewport( array_of_marker_points);
map.centerAndZoom( map_center.center.lng , map_center.center.lat , map_zoom);
https://stackoverflow.com/questions/31538699
复制相似问题