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