简体   繁体   English

openlayers交互事件取消注册

[英]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 收到未定义的错误

You cannot manipulate the internals of the library this way. 您不能以这种方式操作库的内部。 What you can do is use setActive(false) on the interaction. 您可以做的是在交互上使用setActive(false)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM