派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-03-15 3472e776001899505d7dd540a021d07be9c54cd5
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)
      }
    }
    /**