[Vuejs]-Prevent interactions on OpenLayers map while animation is on action

0👍

To deactivate the interactions call a function like disableInteraction():

const disableInteraction = () => {
  map.getInteractions().forEach(i => {
    i.setActive(false)
  })
}

You can call enableInteractions() when the animation stops (or whenever you need), to reactivate the interactions:

const enableInteractions = () => {
  map.getInteractions().forEach(i => {
    i.setActive(true)
  })
}

Leave a comment