我已经拖动ol.interaction.Select,一个用于单击,另一个用于双击。单击并双击,取消选择交互OpenLayers 3
var selectDoubleClick = new ol.interaction.Select({
multi: true,
condition: ol.events.condition.doubleClick,
style: function(feature) {
//stuff here;
}
return feature;
}
selectDoubleClick.on('select',function(event) {
//stuff here
}
var selectSingleClick = new ol.interaction.Select({
multi: true,
condition: ol.events.condition.singleClick,
style: function(feature) {
//stuff here
}
return feature;
}
selectSingleClick.on('select',function(event) {
//stuff here
}
但是,当我想取消选择双击,我必须在地图上点击两次。只需单击一次,双击就可以取消选择任何方式?
您正在分配双击和'返回功能;'没有意义您放置它的位置。它应该在样式函数中吗?我们甚至不知道你的地图是怎么样的,所以你能给我们一个生动的例子,以便我们帮助你吗? – Icarus
是的,这是真的伊卡洛斯,我的错误,但错误仍在继续。当我取消选择通过双击选择的功能时,我也必须取消选择两次点击。 –