From c803e406172652e17ca874ad6dc077ba1cd7cf4a Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期三, 31 三月 2021 18:35:30 +0800 Subject: [PATCH] 弹窗显示 --- src/components/helpers/BasemapHelper.js | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/components/helpers/BasemapHelper.js b/src/components/helpers/BasemapHelper.js index d17a606..cfb5703 100644 --- a/src/components/helpers/BasemapHelper.js +++ b/src/components/helpers/BasemapHelper.js @@ -53,23 +53,15 @@ */ showBasemap = (code, showAnnotation, isHideOthers = true) => { const basemap = this.basemapMap.get(code) - if (isHideOthers) { this.basemapLayerGroup.clearLayers() } - setTimeout(() => { - // const layer = this.basemapLayerGroup.hasLayer(basemap.layer) - // if (!layer) { - this.basemapLayerGroup.addLayer(basemap.layer) - // } - - if (showAnnotation) { - // if() - this.basemapLayerGroup.addLayer(basemap.annotation) - } else { - this.basemapLayerGroup.removeLayer(basemap.annotation) - } - }, 300) + this.basemapLayerGroup.addLayer(basemap.layer) + if (showAnnotation) { + this.basemapLayerGroup.addLayer(basemap.annotation) + } else { + this.basemapLayerGroup.removeLayer(basemap.annotation) + } } /** -- Gitblit v1.8.0