From fc1c4ccc6fb29d8dbd475101047632f83b516a3d Mon Sep 17 00:00:00 2001 From: 徐旺旺 <11530253@qq.com> Date: 星期二, 06 四月 2021 18:21:09 +0800 Subject: [PATCH] 修复bug --- src/components/LayerController/service/LayerFactory.js | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/LayerController/service/LayerFactory.js b/src/components/LayerController/service/LayerFactory.js index 484d6e2..d12719b 100644 --- a/src/components/LayerController/service/LayerFactory.js +++ b/src/components/LayerController/service/LayerFactory.js @@ -1,4 +1,3 @@ -import store from '@/store' import WfsLayerService from './WfsLayerService' import BusiLayerService from './BusiLayerService' import WmsLayerService from './WmsLayerService' @@ -10,17 +9,15 @@ this.layers = {} } - init () { + init (layerConfig) { // 1. 閬嶅巻layer config - var layerConfig = store.state.map.serviceLayers.LayerSewersLine for (var i = 0, l = layerConfig.length; i < l; i++) { var config = layerConfig[i] var layers = config.layers - for (var j = 0; j < layers.length; j++) { - var childConfig = layers[j] - var checked = childConfig.checked - checked && this.load(childConfig) - } + layers && this.init(config.layers) + + var checked = config.checked + checked && this.load(config) } } -- Gitblit v1.8.0