0
我想以编程方式触发选择事件,但我不知道如何。所以,这就是我选择创建互动:如何以编程方式触发选择事件
var selection = new ol.interaction.Select({
...
});
selection.on('select', function (event) {
... here is some action or event I want to trigger
});
在我的代码另一部分,我把新的功能选择:
selection.getFeatures().push(new_feature);
我想是触发select
事件。我怎样才能做到这一点?
谢谢!但似乎我设法用dispatchEvent方法触发事件。 – Jacobian