| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import _, { template } from 'lodash' |
| | | import _ from 'lodash' |
| | | import * as Cesium from 'cesium' |
| | | import setting from './components/setting.vue' |
| | | import useKmzTsa, { kmlStr, template as xmlTemplate } from '/@/utils/cesium/use-kmz-tsa' |
| | | import { ref, reactive, defineEmits, defineProps, watch, onMounted } from 'vue' |
| | | import { ref, defineEmits, defineProps, watch, onMounted } from 'vue' |
| | | import { ArrowLeftOutlined, CaretDownOutlined, SaveOutlined } from '@ant-design/icons-vue' |
| | | import { cesiumOperation } from '/@/hooks/use-cesium-tsa' |
| | | import { useMyStore } from '/@/store' |
| | | import ImageTrailMaterial from '/@/utils/cesium/ImageTrailMaterial' |
| | | import useMapDraw, { kmlEntities as globalEntities, selectPointIndex as pointIdx } from '/@/utils/cesium/use-map-draw' |
| | | import { getKmlParams } from '/@/utils/cesium/kmz' |
| | | import { getHaeHeight } from '/@/utils/cesium/mapUtils' |
| | | import contextMenu from './components/content-menu.vue' |
| | | const store = useMyStore() |
| | | const { appContext }: any = getCurrentInstance() |
| | |
| | | |
| | | const loadCompleted = ref<boolean>(false) |
| | | |
| | | // 编辑时初始化 |
| | | const initDrawRoute = () => { |
| | | const options = { |
| | | camera: global.$viewer.scene.camera, |
| | |
| | | addMapPointEvent() |
| | | } |
| | | }) |
| | | } |
| | | // 新建航线初始化 |
| | | const initCreateRoute = () => { |
| | | mapDraw = useMapDraw('', [], '', global) |
| | | const xml = kmzUtils.generateXML(xmlTemplate.value) |
| | | mapDraw.drawWayline([], xml) |
| | | } |
| | | |
| | | // 创建广告牌 |
| | |
| | | onMounted(() => { |
| | | // 清空画布 |
| | | clearCesiumMap() |
| | | initDrawRoute() |
| | | console.log(!!filePath.value) |
| | | if (filePath.value) { |
| | | initDrawRoute() |
| | | } else { |
| | | initCreateRoute() |
| | | } |
| | | }) |
| | | |
| | | onUnmounted(() => { |