Files
xian_vue_new/src/component/map/Map.vue
T

38 lines
910 B
Vue
Raw Normal View History

2026-04-08 14:18:03 +08:00
<template>
<div class="map_container" id="map-container"></div>
2026-04-09 10:26:30 +08:00
<!-- 行政区划 -->
<AdministrativeDivision v-if="viewerLoadingCompleted"/>
2026-04-08 14:18:03 +08:00
</template>
<script lang="ts" setup>
2026-04-09 10:26:30 +08:00
import { onMounted, ref } from 'vue';
2026-04-08 14:18:03 +08:00
import config from '@/config/config.json';
2026-04-08 18:17:54 +08:00
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
2026-04-09 10:26:30 +08:00
import AdministrativeDivision from './AdministrativeDivision.vue';
2026-04-08 14:18:03 +08:00
2026-04-09 10:26:30 +08:00
// 指示器加载完成
let viewerLoadingCompleted = ref(false);
2026-04-08 14:18:03 +08:00
onMounted(() => {
2026-04-08 18:17:54 +08:00
CesiumUtilsSingleton.initCesiumViewer({
containerId: 'map-container'
2026-04-08 14:18:03 +08:00
})
2026-04-09 10:26:30 +08:00
viewerLoadingCompleted.value = true;
2026-04-08 18:17:54 +08:00
CesiumUtilsSingleton.viewToTarget(config.defaultPosition as [number, number, number]);
2026-04-08 14:18:03 +08:00
})
</script>
<style scoped>
.map_container {
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
}
</style>