From 9ac8fb6d2994d5fcefca1e264f1d62878a3bab7a Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期二, 23 十一月 2021 08:52:46 +0800
Subject: [PATCH] 保持多对象同时高亮

---
 js/function.js      |    7 +++----
 js/function_1001.js |    5 ++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/js/function.js b/js/function.js
index b922aa9..54b45b0 100644
--- a/js/function.js
+++ b/js/function.js
@@ -62,9 +62,6 @@
 mars3d.global_variables.queryDataTStartGeo = getDefaultDateTimeGeo();
 mars3d.global_variables.queryDataTEnd = getDefaultDateTimeEnd();
 mars3d.global_variables.DefaultDateTimeStart = getDefaultDateTimeStart();
-// for tmp hight light graphic and 
-//mars3d.global_variables.tmpHighlightGraphic;
-//mars3d.global_variables.tmpHighlightGraphicLayer;
 
 function initLayersByUserid() {
 
@@ -141,7 +138,9 @@
 
 }
 function addGraphictoHighlightLayer() {
-  mars3d.global_variables.tmpHighlightGraphicLayer.addGraphic(mars3d.global_variables.tmpHighlightGraphic);
+  mars3d.global_variables.tmpHighlightGraphics.forEach((item) => {
+    mars3d.global_variables.tmpHighlightGraphicLayer.addGraphic(item);
+  });
 
 }
 
diff --git a/js/function_1001.js b/js/function_1001.js
index 3b718ea..b9732df 100644
--- a/js/function_1001.js
+++ b/js/function_1001.js
@@ -79,7 +79,7 @@
       speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
       axisY: true,
     })
-    mars3d.global_variables.tmpHighlightGraphic = event.graphic;
+    mars3d.global_variables.tmpHighlightGraphics = event.graphics;
   });
 
   map.addLayer(wmsLyer);
@@ -102,8 +102,7 @@
     console.log("鐩戝惉layer锛屽崟鍑讳簡鐭㈤噺瀵硅薄", event);
     console.log(event.graphic)
     var item = event.graphic?.attr;
-    //haoutil.msg('鍗曞嚮浜嗭細' + item['楂樻牎鍚嶇О'])
-    mars3d.global_variables.tmpHighlightGraphic = event.graphic;
+    mars3d.global_variables.tmpHighlightGraphics = event.graphics;
 
   });
 

--
Gitblit v1.9.1