From 5caa55bd6697e578619ec307ce1f1cde8ac22736 Mon Sep 17 00:00:00 2001 From: soy <59594558+catpotd@users.noreply.github.com> Date: Mon, 13 May 2024 22:32:06 +0900 Subject: [PATCH] fix(web): selection indicator not disappearing on base map click (#7) --- src/engines/Cesium/hooks.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engines/Cesium/hooks.ts b/src/engines/Cesium/hooks.ts index a33c716..129f7f8 100644 --- a/src/engines/Cesium/hooks.ts +++ b/src/engines/Cesium/hooks.ts @@ -571,6 +571,12 @@ export default ({ const viewer = cesium.current?.cesiumElement; if (!viewer || viewer.isDestroyed()) return; + if (!target || typeof target === "undefined" || !("id" in target && target.id)) { + viewer.selectedEntity = undefined; + onLayerSelect?.(); + return; + } + const entity = findEntity(viewer, undefined, selectedLayerId?.featureId) || findEntity(viewer, selectedLayerId?.layerId);