1
A
回答
7
为了显示所有标记在地图上
首先,确保你有所有标记在一个层。
其次,您需要缩放以在标记图层中的所有标记被扩展的地方进行绑定。
要做到这一点,只需
var bounds = markerLayer.getDataExtent();
map.zoomToExtent(bounds);
//has a second parameter that decides to find closest zoom level
//default is false
请检查OpenLayers Document for Marker Layer
问候
迈拉
那钉它 - 感谢 – GilShalit 2010-11-03 21:10:40