From 3c924d71affd630b2411b68061d119f8f2a6d6a2 Mon Sep 17 00:00:00 2001 From: XingChuan <m17600301067@163.com> Date: 星期四, 27 五月 2021 15:20:34 +0800 Subject: [PATCH] 所有报表数据提取出来并更换数据请求方式 --- src/components/LayerController/service/LayerFactory.js | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/components/LayerController/service/LayerFactory.js b/src/components/LayerController/service/LayerFactory.js index 68d8d64..c586a1c 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 杩涜鍒濆鍖栨搷浣� @@ -128,6 +138,15 @@ 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