From ecdffd165cf73c0e3c051c69d1dfdc71ba9331c8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 26 Nov 2024 01:18:01 +0800
Subject: [PATCH] 突发事件模拟调整
---
src/hooks/initMap.js | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/hooks/initMap.js b/src/hooks/initMap.js
index b0ee407..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-22 14:54:14
+ * @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,16 +30,18 @@
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
window.$viewer.zoomToPosition(new DC.Position(
- 115.1048036679409,
- 27.276835758787513,
- 4000,
+ 115.1021,
+ 27.2360,
+ 5000,
0,
- -90,
+ -45,
0
), () => {
store.setLoadMap(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