| | |
| | | <div v-for="(event, index) in item.eventList" :key="index" class="s-event-icon"> |
| | | <a-tooltip placement="top"> |
| | | <template #title> |
| | | {{ event.name }} |
| | | {{ event?.name }} |
| | | </template> |
| | | <img :src="event.icon" alt="icon" /> |
| | | <img :src="event?.icon" alt="icon" /> |
| | | </a-tooltip> |
| | | </div> |
| | | </div> |
| | | </contextMenu> |
| | | </li> |
| | | </ul> |
| | | <startPointTips v-if="xmlTemplate.missionConfig?.takeOffRefPoint['#text'] === ''" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { useMyStore } from '/@/store' |
| | | import useMapDraw, { kmlEntities as globalEntities, selectPointIndex as pointIdx } from '/@/utils/cesium/use-map-draw' |
| | | import contextMenu from './components/content-menu.vue' |
| | | import startPointTips from './components/setting-point-tip.vue' |
| | | const store = useMyStore() |
| | | const { appContext }: any = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | |
| | | // 新建航线初始化 |
| | | const initCreateRoute = () => { |
| | | mapDraw = useMapDraw('', [], '', global) |
| | | const xml = kmzUtils.generateXML(xmlTemplate.value) |
| | | mapDraw.drawWayline([], xml) |
| | | const { |
| | | drawWayline, |
| | | waylineDetails: details, |
| | | waylinePointsEvent, |
| | | kmlEntities: entities, |
| | | clearWaylineData |
| | | } = mapDraw |
| | | clearWaylineData() |
| | | drawWayline() |
| | | waylineDetails.value = details |
| | | tragetPointArr.value = waylinePointsEvent.value |
| | | watch( |
| | | () => waylinePointsEvent.value, |
| | | (val) => { |
| | | tragetPointArr.value = val |
| | | }, |
| | | { |
| | | deep: true, |
| | | }, |
| | | ) |
| | | kmlEntities.value = entities.value |
| | | // const xml = kmzUtils.generateXML(xmlTemplate.value) |
| | | // mapDraw.drawWayline([], xml) |
| | | if (!mouseRightClickEvent) { |
| | | // 添加右键事件 |
| | | addMapPointEvent() |
| | | } |
| | | } |
| | | |
| | | // 创建广告牌 |
| | |
| | | removeCesiumChildDom(popupDom) |
| | | const { position } = click |
| | | const { x, y } = position |
| | | const createTakeOffPointEvent = [{ class: 'start-point', title: '设置参考起飞点' }] |
| | | const pointEvents = [ |
| | | { |
| | | class: 'add-prev-point', |
| | |
| | | }, |
| | | ] |
| | | const defaultEvents = [{ class: 'finally-point', title: '在最后航点新增航点' }] |
| | | const events = selectPointIndex.value !== null ? [...defaultEvents, ...pointEvents] : defaultEvents |
| | | let events = [] |
| | | if (xmlTemplate.value.missionConfig?.takeOffRefPoint['#text'] === '') { |
| | | events = createTakeOffPointEvent |
| | | } else { |
| | | events = selectPointIndex.value !== null ? [...defaultEvents, ...pointEvents] : defaultEvents |
| | | } |
| | | popupDom = createPointPopupDom(events) |
| | | global.$viewer.container.appendChild(popupDom) |
| | | popupDom.style.transform = `translate3d(${x}px, ${y}px, 0)` |
| | |
| | | }, |
| | | isRisky: { '#text': 0 }, |
| | | } |
| | | // 添加参考点 |
| | | if (className === 'start-point') { |
| | | // 默认高度为6 |
| | | const height = 6 |
| | | const takeOffPoint = [latitude, longitude, height] |
| | | xmlTemplate.value.missionConfig.takeOffRefPoint['#text'] = takeOffPoint.join(',') |
| | | } |
| | | // 添加航点 |
| | | if (className === 'finally-point') { |
| | | globalEntities.value.push(entity) |
| | | xmlTemplate.value.Folder.Placemark.push(setting) |
| | |
| | | onMounted(() => { |
| | | // 清空画布 |
| | | clearCesiumMap() |
| | | console.log(!!filePath.value) |
| | | if (filePath.value) { |
| | | initDrawRoute() |
| | | } else { |