吉安感知网项目-前端
shuishen
2026-01-28 275b4e71b35825c820fba57e3a52d3d7ba691920
applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js
@@ -25,6 +25,7 @@
      this.semiMinor = 0
      this.isDrawing = false
      this.drawStep = 0
      this.isCompleted = false
      this.style = resolveStyle(options?.style)
   }
@@ -35,10 +36,12 @@
      this.handler.setInputAction(click => this.handleLeftClick(click), Cesium.ScreenSpaceEventType.LEFT_CLICK)
      this.handler.setInputAction(movement => this.handleMouseMove(movement), Cesium.ScreenSpaceEventType.MOUSE_MOVE)
      this.drawStep = 0
      this.isCompleted = false
      this.tooltip.show('单击设置中心点', { x: 0, y: 0 })
   }
   handleLeftClick(click) {
      if (this.isCompleted) return
      const position = this.getPositionFromScreen(click.position)
      if (!position) return
      if (this.drawStep === 0) {
@@ -65,6 +68,7 @@
         this.semiMinor = Math.min(minorRadius, this.semiMajor)
         this.isDrawing = false
         this.drawStep = 0
         this.isCompleted = true
         const positions = buildEllipsePositions(this.centerCartesian, this.semiMajor, this.semiMinor)
         this.notify('getPolygonPositions', positions)
         this.tooltip.hide()
@@ -73,6 +77,7 @@
   }
   handleMouseMove(movement) {
      if (this.isCompleted) return
      this.tooltip.move(movement.endPosition)
      if (!this.isDrawing) return
      const position = this.getPositionFromScreen(movement.endPosition)
@@ -152,5 +157,6 @@
      this.minorPoint = null
      this.isDrawing = false
      this.drawStep = 0
      this.isCompleted = false
   }
}