Jonathan Groenestein
Jonathan Groenestein

Reputation: 11

openlayers interaction event unregisgistering

I am trying to dynamically change interaction behaviour. It seems to have hit a wall with unregistering the events anyone that can help me with this?

This code:

map.un("click",ol.interaction.DragBox.handleDownEvent_,ol.interaction.DragBox);

gets a undefined error

Upvotes: 0

Views: 114

Answers (1)

bartvde
bartvde

Reputation: 2126

You cannot manipulate the internals of the library this way. What you can do is use setActive(false) on the interaction.

http://openlayers.org/en/v3.4.0/apidoc/ol.interaction.DragBox.html?unstable=true#setActive

Upvotes: 2

Related Questions