From 219f8c029a2abc029e34f079f6ae43bea929500a Mon Sep 17 00:00:00 2001
From: ChenZeping <chenzeping>
Date: 星期四, 29 四月 2021 15:15:11 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop

---
 src/components/LayerController/service/WmsLayerService.js |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/components/LayerController/service/WmsLayerService.js b/src/components/LayerController/service/WmsLayerService.js
index b286194..a303cc8 100644
--- a/src/components/LayerController/service/WmsLayerService.js
+++ b/src/components/LayerController/service/WmsLayerService.js
@@ -45,14 +45,13 @@
   }
 
   add (config) {
-    const code = config.code
-    for (var k in this.layersConfig) {
-      if (code === k) {
-        return false
+    const wmsLayers = config.wmsLayers
+    if (wmsLayers) {
+      if (this.layers.indexOf(wmsLayers) < 0) {
+        this.layers.push(config.wmsLayers)
+        this.wmsLayer.setParams({ layers: this.layers.join(',') })
       }
     }
-    this.layers.push(config.wmsLayers)
-    this.wmsLayer.setParams({ layers: this.layers.join(',') })
   }
 
   remove (config) {

--
Gitblit v1.8.0