I want the user to be able to delete the highlighted feature. This works well, but the feature is not cleared until I move the pointer outside the feature geometry.
I am using the OL 3.5.0 library.
This is the code:
var selectPointerMove_Highlight = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
});
map.addInteraction(selectPointerMove_Highlight);
var selectClick_Delete = new ol.interaction.Select({
condition: ol.events.condition.click
});
map.addInteraction(selectClick_Delete);
selectClick_Delete.getFeatures().on('change:length', function(e) {
var feature = e.target.item(0);
vectorSource.removeFeature(feature);
selectClick_Delete.getFeatures().clear();
selectPointerMove_Highlight.getFeatures().clear();
});
Here is a JSFiddle to show the behaviour. I would expect the highlight to vanish after the clear function is called.
http://jsfiddle.net/goldrydigital/5azhb1o3/
Edit:
I tried a map.renderSync() to force a re-render of the map, but that didn't do it.