吉安感知网项目-前端
shuishen
2026-01-28 275b4e71b35825c820fba57e3a52d3d7ba691920
applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawBufferCircleTool.js
@@ -20,6 +20,7 @@
      this.circleLevel3OutlineEntity = null
      this.isDrawing = false
      this.drawStep = 0
      this.isCompleted = false
   }
   start() {
@@ -29,10 +30,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
@@ -72,6 +75,7 @@
         this.radiusLevel3 = Math.max(radius, this.radiusLevel2)
         this.isDrawing = false
         this.drawStep = 0
         this.isCompleted = true
         const positions = buildEllipsePositions(this.centerCartesian, this.radiusLevel3, this.radiusLevel3)
         this.notify('getPolygonPositions', {
            positions,
@@ -86,6 +90,7 @@
   }
   handleMouseMove(movement) {
      if (this.isCompleted) return
      this.tooltip.move(movement.endPosition)
      if (!this.isDrawing) return
      const position = this.getPositionFromScreen(movement.endPosition)
@@ -226,5 +231,6 @@
      this.radiusLevel3 = 0
      this.isDrawing = false
      this.drawStep = 0
      this.isCompleted = false
   }
}