Openlayers 5如何监视view.center更改
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Openlayers 5如何监视view.center更改相关的知识,希望对你有一定的参考价值。
我目前正在开发一个项目,使用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(){});
以上是关于Openlayers 5如何监视view.center更改的主要内容,如果未能解决你的问题,请参考以下文章
Angular 5,Openlayers 5 使您的弹出(覆盖)可拖动
OpenLayers 6.5.0 不解析具有多种特征类型的 GML 3.2