From 24a3b8ca0a8e3a01d5347c5304a5f64658390294 Mon Sep 17 00:00:00 2001 From: wzy-warehouse <18135009705@163.com> Date: Sun, 14 Jun 2026 20:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=82=B9=E5=87=BB=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/cesium/CesiumUtils.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/cesium/CesiumUtils.ts b/src/utils/cesium/CesiumUtils.ts index 582ab12..621e20f 100644 --- a/src/utils/cesium/CesiumUtils.ts +++ b/src/utils/cesium/CesiumUtils.ts @@ -508,10 +508,11 @@ export class CesiumUtils { clickLayer(callback: (pickedObject: ClickObject) => void) { const handler = new ScreenSpaceEventHandler(this.getViewer()?.scene.canvas); handler.setInputAction((clickEvent: { position: Cartesian2 }) => { - // 在点击位置进行拾取 - const pickedObject = CesiumUtilsSingleton.getViewer()?.scene.pick( - clickEvent.position - ); + const viewer = CesiumUtilsSingleton.getViewer(); + if (!viewer) return; + const pickedList = viewer.scene.drillPick(clickEvent.position); + // 跳过脉冲实体,取第一个非脉冲实体 + const pickedObject = pickedList.find((p) => !p.id?.properties?.pulseKey); callback(pickedObject); }, ScreenSpaceEventType.LEFT_CLICK); } @@ -658,7 +659,7 @@ export class CesiumUtils { const key = `${disasterType}_${lon}_${lat}`; const pulseId = `PULSE_${key}_${Date.now()}`; - this.#createPulseCircle(pulseId, lon, lat, color); + this.#createPulseCircle(pulseId, key, lon, lat, color); this.#pulseMap[key] = { pulseId, probability }; } } @@ -703,6 +704,7 @@ export class CesiumUtils { */ #createPulseCircle( pulseId: string, + key: string, lon: number, lat: number, color: Color @@ -717,6 +719,7 @@ export class CesiumUtils { viewer.entities.add({ id: pulseId, position: Cartesian3.fromDegrees(lon, lat), + properties: { pulseKey: key }, billboard: { image: this.#pulseCircleImage, width: new CallbackProperty((time) => {