What is the best way to add a 'featureover' event on top of an ol.interaction.Modify ? At the map or layer level, this event is masked by the interaction.

The 'modifystart' event is fired when the feature is actually modified, that is after it is selected, and I'd like to know when the mouse is over the feature.

  • I think there isn't any featureover event at all in OL3? For that purpose, you can track mouse position with map.on('pointermove', ... and use map.forEachFeatureAtPixel to detect features. Here's example: openlayers.org/en/v3.13.0/examples/kml.html Feb 2, 2016 at 18:13

1 Answer 1


My bad, I stumbled on an OL2 example with featureover and didn't pay attention. From the KML example given in the above comment, the code below works along with a ol.interaction.Modify :

map.on('pointermove', function(evt) {
    if (evt.dragging) {
    var pixel = map.getEventPixel(evt.originalEvent);
    map.forEachFeatureAtPixel(pixel, function(feature) {
        // your stuff here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.