From 4b00cc926c88d665000b9e99fca10ffdfe331f69 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 26 Nov 2024 01:17:16 +0800
Subject: [PATCH] 静态资源 地图初始化

---
 src/hooks/initMap.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/hooks/initMap.js b/src/hooks/initMap.js
index aea487c..44a9d28 100644
--- a/src/hooks/initMap.js
+++ b/src/hooks/initMap.js
@@ -2,13 +2,15 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2024-10-25 15:09:55
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-23 21:44:24
+ * @LastEditTime: 2024-11-25 16:43:43
  * @FilePath: \bigScreen\src\hooks\initMap.js
  * @Description: 
  * 
  * Copyright (c) 2024 by shuishen, All Rights Reserved. 
  */
 window.$viewer = null
+window.$Cesium = null
+window.$turf = null
 const { VITE_APP_BASE } = import.meta.env
 import { useMap } from 'store/map'
 import { nextTick, onMounted, onUnmounted } from 'vue'
@@ -28,6 +30,8 @@
         baseUrl: `${VITE_APP_BASE}libs/dc-sdk/resources/`,
         turf,
       }).then(() => {
+        window.$Cesium = DC.getLib('Cesium')
+        window.$turf = DC.getLib('turf')
 
         window.$viewer = new DC.Viewer('viewer-container')
         window.$viewer.locationBar.enable = true
@@ -53,7 +57,11 @@
   onUnmounted(() => {
     window.$viewer.destroy()
     window.$viewer = null
+    window.$Cesium = null
+    window.$turf = null
     delete window.$viewer
+    delete window.$Cesium
+    delete window.$turf
     store.setLoadMap(false)
   })
 

--
Gitblit v1.9.3