[GIS] How to define feature modify event in openlayers 3

modify-interactionmodify-interaction-eventopenlayers

I'm using OpenLayers-3.8.2. I have modify interaction as follows:

selectedInteraction = ... 
modifyInteraction = new ol.interaction.Modify({
   features: selectInteraction.getFeatures()
});

I want to define an event that when a point of feature change, it fires. Something like this, but NOT for drawing, for modifying.

How do I do?

Best Answer

there is an event on the select interaction, that fires when you modify a feature and click outside of it:

selectedInteraction.getFeatures().on('add', function(e) {
    e.element.on('change', function(e) {
    //and here e.target is the feature that has been modified
    });
});