|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import {ref,onMounted,defineProps,watch} from 'vue'
|
|
|
|
|
import { message } from 'ant-design-vue';
|
|
|
|
|
|
|
|
|
|
import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
|
|
|
|
|
import {buildUUID} from '@/utils/uuid'
|
|
|
|
|
import airPoint from './airPoint.vue'
|
|
|
|
|
import * as mars3d from "mars3d";
|
|
|
|
@ -57,6 +57,15 @@ watch(
|
|
|
|
|
{ deep: true }
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const clickPoint = (id)=>{
|
|
|
|
|
airPoints.value?.forEach((item,index)=>{
|
|
|
|
|
if(item.id == id){
|
|
|
|
|
currentAirPoint.value = item;
|
|
|
|
|
airPointConfigShow.value = true;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const checkPoint = (e)=>{
|
|
|
|
|
currentAirPoint.value = e;
|
|
|
|
|
airPointConfigShow.value = true;
|
|
|
|
@ -91,7 +100,7 @@ const polygonAirForm = ref({
|
|
|
|
|
startingPoint:null,
|
|
|
|
|
lensMode:1,
|
|
|
|
|
gatherMode:1,
|
|
|
|
|
heightMode:2,
|
|
|
|
|
heightMode:1,
|
|
|
|
|
height:120,
|
|
|
|
|
speed:15,
|
|
|
|
|
angle:0,
|
|
|
|
@ -100,13 +109,11 @@ const polygonAirForm = ref({
|
|
|
|
|
|
|
|
|
|
const vChartRef = ref<HTMLElement>()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
initMap();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initMap = ()=>{
|
|
|
|
|
map = new mars3d.Map(vChartRef.value,
|
|
|
|
|
{
|
|
|
|
@ -348,6 +355,13 @@ const initMap = ()=>{
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
map.addLayer(graphicLayer);
|
|
|
|
|
|
|
|
|
|
// 绘制航线
|
|
|
|
|
graphicLayer.on(mars3d.EventType.click,(e)=>{
|
|
|
|
|
// 设置当前选中点
|
|
|
|
|
|
|
|
|
|
clickPoint(e.graphic.options.id);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 绘制起点
|
|
|
|
|
// handlerDrawStartPoint();
|
|
|
|
@ -396,8 +410,6 @@ const handlerDrawPoint = (e) => {
|
|
|
|
|
|
|
|
|
|
let position = mars3d.LngLatPoint.fromCartesian(e.position);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let uuid = buildUUID();
|
|
|
|
|
|
|
|
|
|
// 航点
|
|
|
|
@ -587,10 +599,12 @@ const handlerDrawPolygon = async () => {
|
|
|
|
|
|
|
|
|
|
let polygon = turf.polygon([coordinates])
|
|
|
|
|
let lines = generateScanLines(polygon,0.003,0);
|
|
|
|
|
|
|
|
|
|
// 绘制区域转存wkt
|
|
|
|
|
let wkt = GeojsonToWkt(polygon.geometry);
|
|
|
|
|
|
|
|
|
|
CalculateAreaInfo(polygon,lines);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 绘制面航线
|
|
|
|
|
handlerDrawPolygonLine(lines);
|
|
|
|
|
}
|
|
|
|
|