From b37aea3e032a573ad0ae6172ee4e08144db6758f Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期二, 19 十一月 2024 17:48:27 +0800 Subject: [PATCH] 功能优化 --- src/components/menu/tools/special.vue | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/menu/tools/special.vue b/src/components/menu/tools/special.vue index 79c7c47..9a0ac40 100644 --- a/src/components/menu/tools/special.vue +++ b/src/components/menu/tools/special.vue @@ -226,6 +226,7 @@ window.divPoint3 = null; window.instance = null; let tooltipHTML; +let tooltip; window.divPoint1 = null; window.pickFeature = null; window.imgUrl = null; @@ -565,6 +566,10 @@ sgworld.Creator.DeleteObject(buildingPolygon); buildingPolygon = null; } + if (tooltip) { + tooltip.show(false); + tooltip = null; + } if (nPickFeature.primitive instanceof Cesium.Billboard) { if (nPickFeature.id.length > 0) { return; @@ -794,11 +799,11 @@ value && (tooltipHTML += `<p>${i}锛�${value || "鏃�"}</p>`); } - // if (tooltip) { - // tooltip.show(false); - // tooltip = null; - // } - var tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, { + if (tooltip) { + tooltip.show(false); + tooltip = null; + } + tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, { color: "black", addY: 0, far: 200000, @@ -810,7 +815,7 @@ } }, }); - console.log(tooltipHTML); + let description = `<div style=' border: 1px solid #fff;border-radius: 5px;background: rgba(0, 0, 0, 0.8);color: #fff;padding: 15px;'>${tooltipHTML}</div>`; tooltip.showAt( -- Gitblit v1.9.3