openlayer 移除map.on(click,地图点击事件

在openlayer API里找了好久也没找到,最后问老同学才解决这个问题,今天记录下来

key = map.on('click', function (e) {
...
}.bind(this));

//移除click

ol.Observable.unByKey(key);

转载自:https://blog.csdn.net/wzk773714339/article/details/86016972

You may also like...

退出移动版