From 89380e6260a75d1d3b94de687ebcc2f50d50659d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Feb 2026 15:44:33 +0800
Subject: [PATCH] feat:环境变量配置调整
---
applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js | 44 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js b/applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js
index a12aaa3..8f77483 100644
--- a/applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js
+++ b/applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js
@@ -1,7 +1,13 @@
import * as Cesium from 'cesium'
import { MapTooltip } from '@ztzf/utils'
import { ToolBase } from '../ToolBase'
-import { buildEllipsePositions, cartesianToLocal } from '../shapeUtils'
+import {
+ buildEllipsePositions,
+ cartesianToLocal,
+ formatBufferRadius,
+ getBufferRadiusLabelStyle,
+ getBufferRadiusPoint,
+} from '../shapeUtils'
const normalizePoints = points =>
(points || []).map(point => ({
@@ -49,6 +55,9 @@
this.radiusLevel1Entity = null
this.radiusLevel2Entity = null
this.radiusLevel3Entity = null
+ this.radiusLevel1LabelEntity = null
+ this.radiusLevel2LabelEntity = null
+ this.radiusLevel3LabelEntity = null
}
start(data = []) {
@@ -97,7 +106,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) {
@@ -111,7 +120,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.dragType) return
const position = this.getPositionFromScreen(evt.endPosition)
if (!position) return
@@ -272,6 +286,10 @@
},
customType: 'circle-radius-3',
})
+
+ this.radiusLevel1LabelEntity = this.createRadiusLabelEntity(() => this.radiusLevel1)
+ this.radiusLevel2LabelEntity = this.createRadiusLabelEntity(() => this.radiusLevel2)
+ this.radiusLevel3LabelEntity = this.createRadiusLabelEntity(() => this.radiusLevel3)
}
updateRadiusPoints() {
@@ -298,9 +316,20 @@
}
getRadiusPoint(radius) {
- const frame = Cesium.Transforms.eastNorthUpToFixedFrame(this.centerCartesian)
- const local = new Cesium.Cartesian3(radius, 0, 0)
- return Cesium.Matrix4.multiplyByPoint(frame, local, new Cesium.Cartesian3())
+ return getBufferRadiusPoint(this.centerCartesian, radius)
+ }
+
+ createRadiusLabelEntity(getRadius) {
+ return this.dataSource.entities.add({
+ position: new Cesium.CallbackProperty(
+ () => getBufferRadiusPoint(this.centerCartesian, getRadius()),
+ false
+ ),
+ label: {
+ ...getBufferRadiusLabelStyle(),
+ text: new Cesium.CallbackProperty(() => formatBufferRadius(getRadius()), false),
+ },
+ })
}
getPositionFromScreen(screenPosition) {
@@ -346,6 +375,9 @@
this.circleLevel1OutlineEntity = null
this.circleLevel2OutlineEntity = null
this.circleLevel3OutlineEntity = null
+ this.radiusLevel1LabelEntity = null
+ this.radiusLevel2LabelEntity = null
+ this.radiusLevel3LabelEntity = null
this.dragType = null
}
}
--
Gitblit v1.9.3