Openlayers 如何使用选择控件连续选择一个功能?
openlayers:6.1.1 我想选择功能。下面是代码:Openlayers 如何使用选择控件连续选择一个功能?,openlayers,Openlayers,openlayers:6.1.1 我想选择功能。下面是代码: const select = new Select({ toggleCondition:singleClick, // removeCondition: singleClick, style:false, }) map.addInteraction(select) select .on('select', callBack) function callBack(result) {
const select = new Select({
toggleCondition:singleClick,
// removeCondition: singleClick,
style:false,
})
map.addInteraction(select)
select .on('select', callBack)
function callBack(result) {
console.log('select',result)
},
当我第一次单击feature时,console.log起作用了。然后我第二次单击feature,什么也没发生。
如何始终分派select事件?
谢谢~它应该可以工作(在这里可以)您不能选择已经选择的功能,但是使用您的toggleCondition每次单击功能都会触发一个事件。谢谢,我看到了。map.on('click')解决所有问题~