From 26c2f1b9194e3df6a6c1c8e337ca5f48b2cbcae5 Mon Sep 17 00:00:00 2001
From: qinbo <qinbo@shsening.com>
Date: 星期三, 10 十一月 2021 11:57:56 +0800
Subject: [PATCH] 勾选显示bug fix
---
widgetsTS/widget_summary/widget.js | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/widgetsTS/widget_summary/widget.js b/widgetsTS/widget_summary/widget.js
index 004c3a4..897a2ff 100644
--- a/widgetsTS/widget_summary/widget.js
+++ b/widgetsTS/widget_summary/widget.js
@@ -97,12 +97,30 @@
selectedItem.forEach(element => {
var path = element.shape;
- if (path != null && path != "null" && path != undefined) {
- var positions = getPositionFromLonLat(path.substring(9, path.length - 2))
+ if(path == null && path == "null" && path == undefined){
+ return;
+ }
+ if (path.substring(0, 1) == "M") {
+ var paths = (path.substring(15, path.length - 3)).split(")),((");
+ paths.forEach(element_path => {
+ var positions = getPositionFromLonLat(element_path)
+ var tmpAttr = deepCopy(element);
+ delete tmpAttr['shape'];
+ this.addPolygonToMap(layerid, qindex, positions, tmpAttr);
+ });
+ } else {
+ var positions = getPositionFromLonLat(path.substring(9, path.length - 2));
var tmpAttr = deepCopy(element);
delete tmpAttr['shape'];
this.addPolygonToMap(layerid, qindex, positions, tmpAttr);
- }
+ }
+
+ // if (path != null && path != "null" && path != undefined) {
+ // var positions = getPositionFromLonLat(path.substring(9, path.length - 2))
+ // var tmpAttr = deepCopy(element);
+ // delete tmpAttr['shape'];
+ // this.addPolygonToMap(layerid, qindex, positions, tmpAttr);
+ // }
});
}
--
Gitblit v1.9.1