无人机管理后台前端(已迁走)
chenyao
2025-09-11 5b73519a2c26fea97b4dfd7f56ee6c4e5ea27dde
src/utils/cesium/publicCesium.js
@@ -94,13 +94,13 @@
         terrain = false,
         layerMode = 0,
         contour = true,
         // flyToContour = false,
         flyToContour = false,
         multiple = 1.4,
         dockOptions = {},
         boundaryColor = '#7FFFD4',
         boundaryChange,
         dockRangeType = 1,
         useDockHeight = false
      } = options
@@ -135,7 +135,7 @@
      this.viewer.clockViewModel.currentTime = Cesium.JulianDate.addHours(utc, 0, new Cesium.JulianDate())
      // 边界,机巢
      this.boundary = useBoundary(this.viewer, { multiple, dockOptions, boundaryChange, boundaryColor, dockRangeType, useDockHeight })
      this.viewer?.imageryLayers.removeAll()
      this.viewer._cesiumWidget._creditContainer.style.display = 'none'
      handler = new Cesium.ScreenSpaceEventHandler(this.viewer?.scene.canvas)
@@ -158,8 +158,8 @@
      this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 4500000
      this.switchLayers(layerMode)
      this.switchFlatMode(flatMode)
      // this.switchContour(contour)
      // flyToContour && this.flyToContour(contour)
      this.switchContour(contour)
      flyToContour && this.flyToContour(contour)
   }
   getViewer () {
@@ -202,21 +202,22 @@
   }
   setShowDock (sns) {
      // this.boundary?.setShowDock(sns)
      this.boundary?.setShowDock(sns)
   }
   // 切换轮廓显示
   // async switchContour (open) {
   //    if (open) {
   //       await this.boundary?.openContour()
   //    } else {
   //       this.boundary?.closeContour()
   //    }
   // }
   async switchContour (open) {
      if (open) {
         await this.boundary?.openContour()
      } else {
         this.boundary?.closeContour()
      }
   }
   // // 飞向轮廓居中
   // flyToContour () {
   //    this.boundary?.flyToBoundary()
   // }
   flyToContour () {
      this.boundary?.flyToBoundary()
   }
   // 飞行 flyto
   flyTo (pointOption, time = 4, height = 3000, orientation = {}, complete = () => { }) {