Reputation: 2196
I'm implementing this example https://openlayers.org/feature-frenzy/examples/editing.html but I can't intercept when a feature is dragged.
This is what I added to the code:
translateInteraction.on('translateend', function (e) {
console.log( e );
});
translateInteraction.on('translating', function (e) {
console.log( e );
});
I create a polygon and then I select and drag it but the events are not fired. My goal is to catch the dragged feature.
Upvotes: 0
Views: 393
Reputation: 17962
That example is using OpenLayers version 3.8.2 which doesn't support those events. They are only available in the final releases of OpenLayers 3 https://openlayers.org/en/v3.20.1/apidoc/ol.interaction.Translate.html and in OpenLayers 4/5/6. If you replace the ol.js link with a more recent version it will work.
Upvotes: 1