| | |
| | | let handler: Cesium.ScreenSpaceEventHandler |
| | | const dimension = ref(3) |
| | | const _init = () => { |
| | | if (viewer) return |
| | | // Cesium Token |
| | | const cesiumToken = import.meta.env.VITE_CESIUM_TOKEN |
| | | Cesium.Ion.defaultAccessToken = cesiumToken |
| | |
| | | }) |
| | | |
| | | // 销毁地图模型 |
| | | onUnmounted(() => { |
| | | viewer = null |
| | | }) |
| | | // onUnmounted(() => { |
| | | // // viewer = null |
| | | // }) |
| | | return { |
| | | addPoint, |
| | | removeAllPoint, |
| | |
| | | } |
| | | // 获取ws连接过来的sn设备号 |
| | | const snCode = ref<string[]>([]) |
| | | const cesium = cesiumOperation() |
| | | // 添加机场标注 |
| | | watch(() => store.state.deviceState, data => { |
| | | const cesium = cesiumOperation(global.$viewer) |
| | | if (snCode.value.includes(data.currentSn)) return |
| | | snCode.value.push(data.currentSn) |
| | | // cesium.removeAllPoint() |