openlayers-3 - 如何在 OpenLayers 3 中注册 map 移动/ map 平移事件

标签 openlayers-3

我正在寻找用于 map 移动/ map 平移的 OpenLayer 3 map 事件,例如:

map.on('move', function(){
  ...
}

有谁知道如何实现?

最佳答案

moveend event 可能是您搜索的那个-它会检测任何移动,即使是那些不是通过拖动调用的移动。

map.on('moveend', function (e) {
    console.log("moved");
});

http://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html

关于openlayers-3 - 如何在 OpenLayers 3 中注册 map 移动/ map 平移事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18185895/

相关文章:

javascript - 开放层 3 : add text label to feature

javascript - OpenLayers 3矢量图层上所有特征的范围?

javascript - 在指定图层的 pointermove 上更改光标样式

javascript - OpenLayers3 中的特征动画

Openlayers 3 - 交互和指针移动

javascript - ol.Map 不是 Safari 的功能,且 map 无法在 IE11 中显示

javascript - 在 OpenLayers 3 中使用 wfs-t?

javascript - OpenLayers 3 - 图层树中的不透明度 slider 不起作用

javascript - 如何将 mouseover/mouseout 监听器添加到 ol.Map?

javascript - OpenLayers 3 hasFeatureAtPixel 图层过滤器