THIS QUESTION IS STILL OPEN AND OF INTEREST
Openlayers: 4.6.5
I have a Modify Interaction and two active Select Interactions. The Modify Interaction is instantiated like this:
var interaction = new ol.interaction.Modify({
source: myLayer.getSource()
});
When I click the edge of a polygon feature, a vertex of this polygon is highlighted - when I draw, the vertex is moved and when I release, the MODIFYEND is triggered. There is obviously exactly one feature affected.
After Modifying a Feature Geometry with the Modify Interaction, I expect the triggered modifyend
event to provide the feature or the geometry that has been affected by the modification. However, it only provides me an ol.Collection containing ALL Features of the interaction's source.
How can I obtain the feature then?
interaction.on(ol.interaction.ModifyEventType.MODIFYEND,function(event) {
// event does not have a feature property
});
Edit: I totally want to avoid this: I found this as a working solution, but I am not happy about it and I don't think this is the appropriate way:
interaction.on(ol.interaction.ModifyEventType.MODIFYEND,function(event) {
var featureModified = interaction.dragSegments_[0][0].feature;
});</s>
toggleCondition: ol.events.condition.never
is set in the select interaction so only one feature can be selected at a time.