OL3是否有Click处理程序pixelTolerance设置?

时间:2016-03-16 11:50:34

标签: javascript openlayers-3

在OpenLayers 2中,可以在Click处理程序中指定pixelTolerance设置。如果地图移动的距离小于或等于此像素数,则也会触发点击事件。

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {  
    defaultHandlerOptions: {  
        'pixelTolerance': 20,  
        ...  
    },  
    ...  
}

问题:OpenLayers 3中有类似内容吗?

1 个答案:

答案 0 :(得分:0)

如果正在拖动地图,您可以实现此监听:

map.on('pointermove', function(evt) {
  if (evt.dragging) {
    console.info('dragging');
  }
});

// another option
map.on('pointerdrag', function(evt) {
  console.info('pointerdrag');
  console.info(evt);
});
相关问题