吉安感知网项目-前端
shuishen
2026-01-28 275b4e71b35825c820fba57e3a52d3d7ba691920
feat:椭圆及缓冲圆绘制逻辑调整
2 files modified
12 ■■■■■ changed files
applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawBufferCircleTool.js 6 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js 6 ●●●●● patch | view | raw | blame | history
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
    }
}
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
    }
}