From 786f4295f9e08b98cf973f90ad7983218c2fd35e Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 15 Jun 2021 16:51:56 +0800
Subject: [PATCH] 地图实体加载方式更改

---
 widgets/searchL/Widget.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
index b549d7c..92c962e 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -29,6 +29,7 @@
 			layers: {},
 			states: 'one',
 			searchDatas: '',
+			addOneEntitys: null,
 			startup: function () {
 				var that = this;
 
@@ -94,7 +95,7 @@
 				})
 				$(".searchColce").click(function () {
 					$('.searchLMain').hide();
-					that.map.entities.removeAll();
+					that.addOneEntitys.removeAll();
 				})
 
 				$("#local_data").keyup(function (e) {
@@ -160,7 +161,7 @@
 				})
 			},
 			createDatas: function (d, n) {
-				this.map.entities.removeAll();//清除图标点
+				this.addOneEntitys.removeAll();//清除图标点
 				if (d == []) {
 					if (n == 0) {
 						this.beginLayUi(d);
@@ -187,6 +188,9 @@
 				}
 			},
 			onOpen: function () {
+				var dataSourceOne = new Cesium.CustomDataSource();
+				this.addOneEntitys = dataSourceOne.entities;
+				this.map.dataSources.add(dataSourceOne);
 				//面板打开的时候触发
 				var that = this;
 				that.getData(0)
@@ -301,7 +305,7 @@
 			//定位实体位置
 			shiti: function (data, i) {
 				var imgs = i == 1 ? 'images/addL/全景.png' : i == 2 ? 'images/addL/监控.png' : i == 3 ? 'images/addL/监测.png' : '';
-				this.map.entities.add({
+				this.addOneEntitys.add({
 					id: data.id, // 实体ID
 					name: data.name, // 实体名称
 					position: Cesium.Cartesian3.fromDegrees(Number(data.lon), Number(data.lat)), // x,y 实体经纬度

--
Gitblit v1.9.3