From d8a0684a057df926c788525575eecdddde977133 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期日, 20 四月 2025 15:45:34 +0800 Subject: [PATCH] change --- src/views/mnfz.vue | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/views/mnfz.vue b/src/views/mnfz.vue index c92927c..c8b562d 100644 --- a/src/views/mnfz.vue +++ b/src/views/mnfz.vue @@ -49,7 +49,8 @@ waterSimulateParams.value = form; } function endSimulate() { - // showDebuffDetail.value = true + showDebuffDetail.value = false + clearTrailLine(); removeDataSources(); setTimeout(() => { showWaterSimulate.value = false; @@ -67,8 +68,8 @@ // 璁剧疆鏍峰紡锛屽皢棰滆壊鏀逛负绾㈣壊 dataSource.entities.values.forEach((entity) => { entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 绾㈣壊锛�80% 涓嶉�忔槑搴� - entity.polygon.outlineColor = Cesium.Color.YELLOW; // 璁剧疆杞粨棰滆壊涓虹孩鑹诧紙濡傛灉闇�瑕侊級 - entity.polygon.outline = true; // 鏄剧ず杞粨锛堝鏋滈渶瑕侊級 + entity.polygon.outlineColor = Cesium.Color.YELLOW; + entity.polygon.outline = true; }); // 娣诲姞鏁版嵁婧愬埌 viewer @@ -156,6 +157,19 @@ ); TrailLine.push(_TrailLine); } +// 娓呴櫎杞ㄨ抗绾垮璞� +function clearTrailLine() { + TrailLine.forEach((item, index) => { + if (item && typeof item.deleteObject === 'function') { + item.deleteObject(); + } else if (item && typeof item.clear === 'function') { + item.clear(); + } else if (item && earthCtrl && earthCtrl.coreMap) { + earthCtrl.coreMap.entities.remove(item); + } + }); + TrailLine = []; +} // function showLine() { // earthCtrl.factory.createSimpleGraphic( // "polyline", -- Gitblit v1.9.3