我目前正在开发一个项目,使用openlayers 5的observable来观察地图中的一些项目并做出相应的响应。
http://openlayers.org/en/latest/apidoc/module-ol_Observable-Observable.html
我想要做的是每次视图中心改变时,我想调用一个函数。我现在正在这样做(但它不起作用)。
view.on('center', function(event){
// do something with the center
});
有小费吗?
得到它了。我错过了文字“改变”。
view.on('change:center', function(){});