派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-03-08 95ff3cadc7685f6470a0d6c78429dbfd5b1451d9
src/components/helpers/BasemapHelper.js
@@ -11,6 +11,7 @@
    this.basemapList = []
    this.basemapMap = new Map()
    this.basemapLayerGroup = this.L.layerGroup().addTo(options.map)
    this.currentBaseMapCode = null
  }
    /**
@@ -52,13 +53,23 @@
     */
    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)
    }
    /**