智慧园区前端大屏
shuishen
2024-11-07 3a1224b26d091fb6a2a08555054acb05592d357c
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 {