代码优化

main
zhufu 8 months ago
parent 80849f080d
commit 4ae9bae92c

@ -143,26 +143,6 @@
getMaskData()
handlerDealStreet()
handlerDealCountry();
//
// addMonitorLayer();
//
try{
axios.get(VITE_GLOB_LAN_API_URL+"/api/DroneCloudQuery/IsPublic").then(res=>{
if(res.data.result){
networkType.value = "WAN";
}else{
networkType.value = "LAN";
//
loadYingXiangLayer()
}
})
}catch(e){
networkType.value = "WAN";
}finally{
}
});
@ -520,44 +500,6 @@
}
}
};
function loadYingXiangLayer(){
map.addSource("yaogan", {
type: 'raster',
tiles: [VITE_GLOB_YAOGANYINGXIANG_SERVER],
tileSize: 256,
minzoom: 16,
maxzoom: 24,
})
map.addSource("yingxiang", {
type: 'raster',
tiles: [VITE_GLOB_YINGXIANG_SERVER],
tileSize: 256,
minzoom: 16,
maxzoom: 24,
})
map.addLayer({
id: 'yaogan',
type: 'raster',
source: 'yaogan',
layout: {
visibility: networkType.value == 'LAN' ? 'visible' : 'none',
},
minzoom: 9,
maxzoom: 15,
})
map.addLayer({
id: 'yingxiang',
type: 'raster',
source: 'yingxiang',
layout: {
visibility: networkType.value == 'LAN' ? 'visible' : 'none',
},
minzoom: 13,
maxzoom: 24,
})
}
const handlerChangeLayer = (list) => {
let filterJosn = `&filter="RelationType" IN (${list.length > 0? list.join(','): -1})`
handlerLoadPolygon("","","","",filterJosn)

Loading…
Cancel
Save