派生自 wuyushui/SewerAndRainNetwork

chenyibo
2021-04-02 21c0837e6f96ada513d3bd5210d96f8ff8681c5d
src/components/helpers/BasemapHelper.js
@@ -1,5 +1,6 @@
/* eslint-disable no-debugger */
import AjaxUtils from '@/utils/AjaxUtils'
import * as utils from '../../utils/utils'
/**
 * 底图管理助手,负责底图创建及开关
@@ -11,6 +12,7 @@
    this.basemapList = []
    this.basemapMap = new Map()
    this.basemapLayerGroup = this.L.layerGroup().addTo(options.map)
    this.currentBaseMapCode = null
  }
    /**
@@ -58,6 +60,8 @@
      this.basemapLayerGroup.addLayer(basemap.layer)
      if (showAnnotation) {
        this.basemapLayerGroup.addLayer(basemap.annotation)
      } else {
        this.basemapLayerGroup.removeLayer(basemap.annotation)
      }
    }
@@ -76,6 +80,11 @@
      const internetBasemaps = config.mapConfig.InternetBaseMaps
      for (let i = 0, len = internetBasemaps.length; i < len; ++i) {
        const basemapConfig = internetBasemaps[i]
        const mapToken = utils.getRandomTDTToken()
        const mapUrl = utils.changeURLArg(basemapConfig.map.url, 'tk', mapToken)
        console.log(mapToken)
        console.log(mapUrl)
        console.log(basemapConfig.map.url)
        const basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option)
        const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option)