Compare commits

...

2 Commits

Author SHA1 Message Date
秦子超 99d9008627 合并 2025-06-11 11:31:37 +08:00
秦子超 8e75910321 修改水库切换 2025-06-11 11:29:32 +08:00
3 changed files with 32 additions and 8 deletions

View File

@ -570,12 +570,12 @@ const map = {
dispatch.runtime.setYyfa({})
}
if (
id === 3
|| id === 203
|| id === 205
|| id === 206
) {
if (
id === 3
|| id === 203
|| id === 205
|| id === 206
) {
dispatch.map.setLayerSetting({ dom: true });
// map.setLayoutProperty('卫星图', 'visibility', 'visible');
} else {
@ -741,7 +741,6 @@ const map = {
10, 0.4,
14, 0.8,
],
'text-allow-overlap': true,
'text-size': [
'interpolate', ['linear'], ['zoom'],
@ -765,7 +764,14 @@ const map = {
'visibility': 'visible',
});
map.getSource('关联站点').setData(parseGeoJSON(skdata))
}
if(id!==200&&id!==203&&id!==205&&id!==206){
const layer = map.getLayer('临时水库tz')
if(layer){
map.removeLayer('临时水库tz');
map.removeSource('临时水库tz');
}
}
}
})

View File

@ -88,7 +88,16 @@ function ARzSk({data}) {
"strarz": "4.66"
}];
useEffect(()=>{
return ()=>{
const map = window.__mapref;
const layer = map.getLayer('临时水库')
if(layer){
map.removeLayer('临时水库');
map.removeSource('临时水库');
}
}
},[])
const dispatch = useDispatch();
const flyTo = (record) => {

View File

@ -42,6 +42,15 @@ function DrpReal({ style }) {
useEffect(()=>{
getSkData()
// return ()=>{
// const map = window.__mapref;
// const layer = map.getLayer('临时水库tz')
// if(layer){
// map.removeLayer('临时水库tz');
// map.removeSource('临时水库tz');
// }
// }
},[])
const getSkData = async()=>{