各种版本包下载地址:https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js
2.setView中,zoom改变之后底图只缩放不更新加载:
3.监听地图分辨率事件
map.getView().on('change:resolution',checkZoom);//checkZoom为调用的函数
function checkZoom() {
console.log(map.getView().getZoom());
if (map.getView().getZoom() == 11) {
// console.log(vector.getSource().getFeatures()[0].getProperties().CODE);
// childId = vector.getSource().getFeatures()[0].getProperties().CODE;
// vector.setVisible(false);
lastVectorShow();
}
}