1

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?

1
  • 1
    Listening on "change:geometry" of the translated feature, the event is fired continuously while dragging..
    – mantonovic
    Commented Sep 29, 2015 at 8:48

2 Answers 2

9

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)

0
2

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

1
  • event "translateend" is now available
    – TeChn4K
    Commented Jan 19, 2017 at 14:45

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