openlayers 3监听地图分辨率变化事件


 1 map.getView().on('change:resolution',checkZoom);//checkZoom为调用的函数
 2 
 3 function checkZoom() {
 4     // alert("1");
 5     // var childId;
 6     console.log(map.getView().getZoom());
 7     if (map.getView().getZoom() == 11) {
 8         // console.log(vector.getSource().getFeatures()[0].getProperties().CODE);
 9         // childId = vector.getSource().getFeatures()[0].getProperties().CODE;
10         // vector.setVisible(false);
11         lastVectorShow();
12 
13     }
14 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM