From 3a1224b26d091fb6a2a08555054acb05592d357c Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 07 Nov 2024 19:25:43 +0800
Subject: [PATCH] 应急物资、救援队伍去除地图单页处理
---
src/hooks/initMap.js | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/hooks/initMap.js b/src/hooks/initMap.js
index 5569c85..3d10d98 100644
--- a/src/hooks/initMap.js
+++ b/src/hooks/initMap.js
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-10-25 15:09:55
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-07 16:15:48
+ * @LastEditTime: 2024-11-07 19:24:27
* @FilePath: \bigScreen\src\hooks\initMap.js
* @Description:
*
@@ -11,7 +11,7 @@
let viewer = null
const { VITE_APP_BASE } = import.meta.env
import { useMap } from 'store/map'
-import { nextTick } from 'vue'
+import { nextTick, onMounted, onUnmounted } from 'vue'
export function readyViewer () {
const Cesium = DC.getLib('Cesium')
@@ -43,7 +43,16 @@
})
}
- initMap()
+ onMounted(() => {
+ initMap()
+ })
+
+ onUnmounted(() => {
+ viewer.destroy()
+ viewer = null
+ delete window.$viewer
+ store.setLoadMap(false)
+ })
return {
--
Gitblit v1.9.3