chenyao
2025-02-28 32fe6e21781de5ff3218ffe71454a023c56ef50e
src/views/hooks/droneFly.ts
@@ -7,7 +7,7 @@
import { useMyStore } from '@/store'
import { getTwoPointInfo } from '@/api/manage'
const { getEntityById, removeById, globalCesium, addLeftClickEvent, removeLeftClickEvent, flyTo } = cesiumOperation()
const { getEntityById, removeById, globalCesium, removeAllPoint, addLeftClickEvent, removeLeftClickEvent, flyTo } = cesiumOperation()
// 无人机实体
let droneEntity = null
@@ -63,7 +63,7 @@
      // 当飞机模型存在
      if (droneEntity) {
        //  且在空中飞行时,实时更新飞机模型的位置
        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 16].includes(deviceInfo.mode_code)) {
        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 16, 17].includes(deviceInfo.mode_code)) {
          if (store.currentAngle == 3) {
            viewInfoFrustum?.clear()
          } else {
@@ -96,6 +96,9 @@
        } else {
          removeById('drone_fly')
          droneEntity = null
          removeById('me_dw')
          myAppEntity = null
  
          lastTime = null
          viewInfoFrustum?.clear()
@@ -103,9 +106,10 @@
  
          window.cesiumViewer.camera.lookAtTransform(globalCesium.Matrix4.IDENTITY)
          store.commit('SET_CURRENTANGLE', 1)
          removeAllPoint()
        }
      } else {
        if (deviceInfo.mode_code && [3, 4, 5, 9, 10].includes(deviceInfo.mode_code)) {
        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 17].includes(deviceInfo.mode_code)) {
          // 暂时把视锥代码注释掉
          initCreateFrustum(deviceInfo, viewDroneInfo)
          addFlyGltf(
@@ -146,7 +150,7 @@
        })
      }
      
      if (data.deviceInfo[data.currentSn].mode_code && [3, 4, 5, 9, 10].includes(deviceInfo.mode_code)) {
      if (data.deviceInfo[data.currentSn].mode_code && [3, 4, 5, 9, 10, 17].includes(deviceInfo.mode_code)) {
        if (switchSaving) return (switchSaving = false)
        const newPositions = globalCesium.Cartesian3.fromDegrees(
          data.deviceInfo[data.currentSn].longitude,