mantonovic
mantonovic

Reputation: 55

Listen for end of translation using ol.interaction.Translate

I'm playing with the new Translate interaction (ol.interaction.Translate) added in v3.9.0. I am wondering if there is a way to listen for an event notifying the end of the translation?

Upvotes: 1

Views: 2591

Answers (2)

TeChn4K
TeChn4K

Reputation: 2405

There is a new event now : translateend

const myTanslate = new ol.interaction.Translate({
  layers: [myLayer],
})

myTanslate.on('translateend', evt => {
  evt.features.forEach(feat => {
    // process every feature
  })
})

PS edit: don't forget to add interaction to your map with map.addInteraction(myTanslate)

Upvotes: 9

bartvde
bartvde

Reputation: 2126

Not as yet see: https://github.com/openlayers/ol3/pull/4161 for a possible solution

Upvotes: 2

Related Questions