From e3608132cc667c16ea10f450807e0feddaf55d1f Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期日, 30 五月 2021 13:32:38 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
---
src/components/LayerController/service/LayerFactory.js | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/components/LayerController/service/LayerFactory.js b/src/components/LayerController/service/LayerFactory.js
index 68d8d64..f7230ba 100644
--- a/src/components/LayerController/service/LayerFactory.js
+++ b/src/components/LayerController/service/LayerFactory.js
@@ -106,6 +106,16 @@
return layer
}
+ showAll (configs) {
+ if (Array.isArray(configs)) {
+ for (let i = 0; i < configs.length; i++) {
+ const config = configs[i]
+ this.show(config)
+ }
+ this.wmsLayerService && this.wmsLayerService.addAll(configs)
+ }
+ }
+
/**
* 濡傛灉 瀛樺湪宸茬粡鍔犺浇浜嗙殑瀵硅薄锛屽氨鐩存帴鍔犲埌map
* 濡傛灉 涓嶅瓨鍦ㄥ垯 璋冪敤 addLayer 鍙� 閫昏緫绫荤殑init 杩涜鍒濆鍖栨搷浣�
@@ -122,12 +132,21 @@
layer.addTo(this.map)
}
} else {
- logic && logic.init(this.addLayer(config), this.L)
+ logic && logic.init(this.addLayer(config), this.L, config)
}
logic && logic.start && logic.start()
this.wmsLayerService && this.wmsLayerService.add(config)
}
+ hideAll (configs) {
+ if (Array.isArray(configs)) {
+ for (let i = 0; i < configs.length; i++) {
+ this.hide(configs[i])
+ }
+ this.wmsLayerService && this.wmsLayerService.removeAll(configs)
+ }
+ }
+
hide (config) {
const code = config.code
const layer = this.layers[code]
--
Gitblit v1.8.0