From 47af46140c4ca30488030e93d20a1965b2c848a2 Mon Sep 17 00:00:00 2001
From: YANGDL <114714267@qq.com>
Date: 星期一, 08 三月 2021 17:57:23 +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