diff --git a/src/views/sponeScreen/HaiMianScreen/index.vue b/src/views/sponeScreen/HaiMianScreen/index.vue index 73ca7d3..9843ebf 100644 --- a/src/views/sponeScreen/HaiMianScreen/index.vue +++ b/src/views/sponeScreen/HaiMianScreen/index.vue @@ -65,6 +65,7 @@ import LongYW from '@/views/sponeScreen/longYW/index.vue'; //长效运维 import axios from 'axios'; import NewFiberMapUtils from '@/utils/gis/NewFiberMapUtils'; +import { onBeforeUnmount } from 'vue'; const { proxy } = getCurrentInstance(); const router = useRouter(); @@ -101,6 +102,10 @@ show: true, }, { + layername: 'sewageFactory', + show: true, + }, + { layername: 'rainLine', show: true, }, @@ -117,6 +122,10 @@ show: false, }, { + layername: 'sewageFactory', + show: false, + }, + { layername: 'rainLine', show: false, }, @@ -150,6 +159,18 @@ onMounted(() => { getWeather(); }); +onBeforeUnmount(() => { + if (newfiberMap) { + let _originalGLContext = newfiberMap.getMap().scene?.context._originalGLContext; + newfiberMap.getMap().destroy(); + if (_originalGLContext) { + _originalGLContext.getExtension('WEBGL_lose_context').loseContext(); + _originalGLContext = null; + } + newfiberMap.baseMap.map = null; + newfiberMap = null; + } +});