From 95c1f10a276a69ce4fdcc72e68a35c796581d143 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 11 Jun 2021 16:19:19 +0800
Subject: [PATCH] 左侧目录树优化,及搜索部分样式调整,部分图片路径更改

---
 widgets/LeftNavigationBar/Widget.js |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/widgets/LeftNavigationBar/Widget.js b/widgets/LeftNavigationBar/Widget.js
index 1a7e5ac..c9ef115 100644
--- a/widgets/LeftNavigationBar/Widget.js
+++ b/widgets/LeftNavigationBar/Widget.js
@@ -198,6 +198,7 @@
 				})
 			},
 			changeData: function (val, type) { //重写数据
+				var that = this;
 				var data = [],
 					i = 1,
 					inits = (d, childData) => {
@@ -227,6 +228,21 @@
 								a.model = true
 							}
 
+							if (a.model) {
+
+								if (that[a.id]) {
+									Cesium.when(that[a.id], function (layer) {
+										that.map.scene.layers.remove(layer[0].name)
+									})
+								}
+
+							} else {
+
+								if (that[a.id]) { 
+									that.map.imageryLayers.remove(that[a.id]);
+								}
+
+							}
 
 							b.push(a);
 							i++;
@@ -234,7 +250,7 @@
 								b[k].children = [];
 								b[k].who = 'father';
 								inits(d[k].children, b[k].children)
-							}
+							} 
 						}
 
 					};

--
Gitblit v1.9.3