From e4439e5d0a2cba9983f013bd044fe4e22c7b7077 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 11 Feb 2026 16:35:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js b/applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js
index 88674c7..207ad4e 100644
--- a/applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js
+++ b/applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js
@@ -91,6 +91,9 @@
}
start() {
+ if (!this.tooltip) {
+ this.tooltip = new MapTooltip(this.viewer)
+ }
this.dataSource = new Cesium.CustomDataSource('draw-polygon')
this.viewer.dataSources.add(this.dataSource)
this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
@@ -137,12 +140,18 @@
handleMouseMove(movement) {
if (!this.isDrawing) return
+ const tipText = this.getTipText()
+ if (!this.tooltip?.isVisible) {
+ this.tooltip?.show(tipText, movement.endPosition)
+ } else {
+ this.tooltip?.show(tipText)
+ this.tooltip?.move(movement.endPosition)
+ }
if (this.positions.length === 0) return
const position = this.getPositionFromScreen(movement.endPosition)
if (!position) return
this.lastMousePosition = position
this.floatPosition = position
- this.tooltip.show(this.getTipText(), movement.endPosition)
}
getTipText() {
@@ -277,7 +286,7 @@
this.floatPosition = null
this.isIntersecting = false
this.notify('getPolygonPositions', this.positions)
- this.tooltip.hide()
+ this.tooltip?.hide()
this.clearPreviewEntities()
}
--
Gitblit v1.9.3