修改水库切换
parent
8fafed3199
commit
8e75910321
|
|
@ -564,12 +564,12 @@ const map = {
|
||||||
dispatch.runtime.setYyfa({})
|
dispatch.runtime.setYyfa({})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
id === 3
|
id === 3
|
||||||
|| id === 203
|
|| id === 203
|
||||||
|| id === 205
|
|| id === 205
|
||||||
|| id === 206
|
|| id === 206
|
||||||
) {
|
) {
|
||||||
dispatch.map.setLayerSetting({ dom: true });
|
dispatch.map.setLayerSetting({ dom: true });
|
||||||
// map.setLayoutProperty('卫星图', 'visibility', 'visible');
|
// map.setLayoutProperty('卫星图', 'visibility', 'visible');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -577,6 +577,14 @@ const map = {
|
||||||
// map.setLayoutProperty('卫星图', 'visibility', 'none');
|
// map.setLayoutProperty('卫星图', 'visibility', 'none');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(id!==200&&id!==203&&id!==205&&id!==206){
|
||||||
|
const layer = map.getLayer('临时水库tz')
|
||||||
|
if(layer){
|
||||||
|
map.removeLayer('临时水库tz');
|
||||||
|
map.removeSource('临时水库tz');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,16 @@ function ARzSk({data}) {
|
||||||
"strarz": "4.66"
|
"strarz": "4.66"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
return ()=>{
|
||||||
|
const map = window.__mapref;
|
||||||
|
const layer = map.getLayer('临时水库')
|
||||||
|
if(layer){
|
||||||
|
map.removeLayer('临时水库');
|
||||||
|
map.removeSource('临时水库');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[])
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const flyTo = (record) => {
|
const flyTo = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,15 @@ function DrpReal({ style }) {
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
getSkData()
|
getSkData()
|
||||||
|
|
||||||
|
// return ()=>{
|
||||||
|
// const map = window.__mapref;
|
||||||
|
// const layer = map.getLayer('临时水库tz')
|
||||||
|
// if(layer){
|
||||||
|
// map.removeLayer('临时水库tz');
|
||||||
|
// map.removeSource('临时水库tz');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
const getSkData = async()=>{
|
const getSkData = async()=>{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue