吉安感知网项目-前端
shuishen
2026-02-03 89380e6260a75d1d3b94de687ebcc2f50d50659d
applications/drone-command/src/utils/cesium/shapeTools/edit/EditRectangleTool.js
@@ -1,5 +1,5 @@
import * as Cesium from 'cesium'
import { MapTooltip } from '../Tooltip'
import { MapTooltip } from '@ztzf/utils'
import { ToolBase } from '../ToolBase'
import { getBoundsFromLngLats, rectanglePositionsFromBounds } from '../shapeUtils'
@@ -47,7 +47,7 @@
      this.handler.setInputAction(evt => this.handleLeftDown(evt), Cesium.ScreenSpaceEventType.LEFT_DOWN)
      this.handler.setInputAction(evt => this.handleMouseMove(evt), Cesium.ScreenSpaceEventType.MOUSE_MOVE)
      this.handler.setInputAction(() => this.handleLeftUp(), Cesium.ScreenSpaceEventType.LEFT_UP)
      this.tooltip.show('拖动顶点编辑', { x: 0, y: 0 })
      this.tooltip.hide()
   }
   handleLeftDown(evt) {
@@ -60,7 +60,12 @@
   }
   handleMouseMove(evt) {
      this.tooltip.move(evt.endPosition)
      if (!this.tooltip?.isVisible) {
         this.tooltip.show('拖动顶点编辑', evt.endPosition)
      } else {
         this.tooltip.show('拖动顶点编辑')
         this.tooltip.move(evt.endPosition)
      }
      if (this.dragIndex == null) return
      const position = this.getPositionFromScreen(evt.endPosition)
      if (!position) return
@@ -139,9 +144,7 @@
   }
   getCornerCartographics() {
      return rectanglePositionsFromBounds(this.bounds).map(position =>
         Cesium.Cartographic.fromCartesian(position)
      )
      return rectanglePositionsFromBounds(this.bounds).map(position => Cesium.Cartographic.fromCartesian(position))
   }
   getPositionFromScreen(screenPosition) {