OpenLayers部分方法事件

一、设置中心坐标
map.setCenter(point, zoom);
二、删除标记
markers.removeMarker(marker);
三、移动标记
marker.moveTo(map.getLayerPxFromViewPortPx(e.xy));
四。获取中心坐标
map.getCenter();
五、获取扩大倍数
map.getZoom();
六、地图添加单击时间
map.events.register(“click”, null, move);
七、地图取消单击时间
map.events.unregister(“click”, null, move);
八、标记添加鼠标移动时间
marker.events.register(“mousemove”, feature, markerMove);
九、标记添加鼠标移动时间
marker.events.register(“mouseout”, feature, function markerOut(){map.removePopup(popup);});
十、获取当前坐标
map.getLonLatFromPixel(e.xy).transform(new OpenLayers.Projection(“EPSG:900913”),new OpenLayers.Projection(“EPSG:4326”));
转载自:https://blog.csdn.net/iteye_17205/article/details/82305467

You may also like...

退出移动版