| | |
| | | this.basemapList = [] |
| | | this.basemapMap = new Map() |
| | | this.basemapLayerGroup = this.L.layerGroup().addTo(options.map) |
| | | this.currentBaseMapCode = null |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | 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) |
| | | } |
| | | |
| | | /** |