//監聽分辨率變化
Map.map.getView().on('change:resolution', function(){
var zoom = Map.map.getView().getZoom();
if(zoom>=10){
console.info("當前層級:"+zoom);
var extent =Map.map.getView().calculateExtent(Map.map.getSize());
console.info(extent);
var features = parent.GlobalOLTOWER.tower_750.getSource().getFeaturesInExtent(extent); //先縮小feature的范圍
console.info(features);
}else{
console.info("層級未達到")
}
});
//監聽地圖實時的 extent
Map.map.on('moveend', function () {
var zoom = Map.map.getView().getZoom();
if(zoom>=10){
console.info("當前層級:"+zoom);
var extent =Map.map.getView().calculateExtent(Map.map.getSize());
console.info(extent);
var features = parent.GlobalOLTOWER.tower_750.getSource().getFeaturesInExtent(extent); //先縮小feature的范圍
console.info(features);
}else{
console.info("層級未達到")
}
});