From affd4f4dc24a81fa0ab9a1d96336a7db5fd51050 Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Thu, 25 Jan 2024 16:00:28 +0800
Subject: [PATCH] 取消图斑

---
 src/components/g-map/DroneControlPanel.vue |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/components/g-map/DroneControlPanel.vue b/src/components/g-map/DroneControlPanel.vue
index 7747c6d..55671e0 100644
--- a/src/components/g-map/DroneControlPanel.vue
+++ b/src/components/g-map/DroneControlPanel.vue
@@ -14,9 +14,9 @@
                             {{ flightController ? '退出控制' : '进入控制' }}
                         </Button>
 
-                      <Button  size="small" @click="flyByPoints">
-                        图斑飞行
-                      </Button>
+<!--                      <Button  size="small" @click="flyByPoints">-->
+<!--                        图斑飞行-->
+<!--                      </Button>-->
                     </div>
                 </div>
                 <div class="row">
@@ -321,6 +321,7 @@
 import { parseJsonFile } from '/@/utils/geo-utils'
 import { cesiumOperation } from '/@/hooks/use-cesium-tsa'
 import * as Cesium from 'cesium'
+import { start } from 'repl'
 const props = defineProps<{
     sn: string,
     deviceInfo: DeviceInfoType,
@@ -524,10 +525,16 @@
   // })
 
   flyByArea(sn, dockPoint, jsonPath, radius, deviceSn, payloadIndex).then(res => {
-    const targetPoint = res.data
+    const targetPoint = res.data || []
+    // 机场位置
+    const startPoint = {
+      lon: props.deviceInfo.dock.basic_osd.longitude,
+      lat: props.deviceInfo.dock.basic_osd.latitude
+    }
+    targetPoint.unshift(startPoint)
     console.log('targetPoint====', targetPoint)
     // 获取到点之后在图上绘点
-    targetPoint.forEach((point, index) => {
+    targetPoint.forEach((point: { lon: number; lat: number }, index: number) => {
       console.log(point)
       const setting = {
         longitude: point.lon,

--
Gitblit v1.9.3