派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-01-05 77f7281ff7cee541aaa51339512e6443b7d89e42
src/components/helpers/ServiceLayerHelper.js
@@ -35,7 +35,7 @@
    _loadLayers(mapConfig, isAddToMap = true) {
        console.debug('ServiceLayerHelper加载参数:', mapConfig)
        for (let i = 0, len = mapConfig.mapConfig.ServiceLayers.length; i < len; ++i) {
            let opt = mapConfig.mapConfig.ServiceLayers[i]
      const opt = mapConfig.mapConfig.ServiceLayers[i]
            if (opt.type === 'wmts') {
                this.loadWmtsLayer(opt, isAddToMap, mapConfig.mapConfig.ServiceLayers[i])
            } else if (opt.type === 'wms') {
@@ -52,7 +52,7 @@
     * @param {*} isAddToMap
     */
    loadWmtsLayer(options, isAddToMap = true, config) {
        const layer = this.L.tileLayer(options.url, options.option);
    const layer = this.L.tileLayer(options.url, options.option)
        layer.config = config
        if (isAddToMap) {
@@ -68,7 +68,7 @@
     * @param {*} isAddToMap
     */
    loadWmsLayer(options, isAddToMap = true, config) {
        const layer = this.L.tileLayer.wms(options.url, options.option);
    const layer = this.L.tileLayer.wms(options.url, options.option)
        layer.config = config
        if (isAddToMap) {
@@ -86,13 +86,13 @@
    loadTileLayer(options, isAddToMap = true, config) {
        const layer = this.L.tileLayer(options.url, {
            layers: options.layers || 'all',//country
            format: options.format || "image/png",
      format: options.format || 'image/png',
            transparent: options.true || true,
            crs: options.crs || L.CRS.EPSG4326,
            maxZoom: options.maxZoom || 21,
            minZoom: options.minZoom || 1,
            zoomOffset: options.zoomOffset || 0
        });
    })
        layer.config = config
        if (isAddToMap) {
@@ -108,7 +108,7 @@
     */
    hideTileLayer(code) {
        if (this.tileLayersMap) {
            let tileLayer = this.tileLayersMap.get(code)
      const tileLayer = this.tileLayersMap.get(code)
            this.map.removeLayer(tileLayer)
        }
    }
@@ -119,7 +119,7 @@
     */
    showTileLayer(code) {
        if (this.tileLayersMap) {
            let tileLayer = this.tileLayersMap.get(code)
      const tileLayer = this.tileLayersMap.get(code)
            this.map.addLayer(tileLayer)
        }
    }
@@ -150,7 +150,7 @@
     * @param {} code wms服务配置的code
     */
    getWMSConfig(code) {
        let mc = this.mapConfig
    const mc = this.mapConfig
        for (let i = 0, len = mc.mapConfig.ServiceLayers.length; i < len; ++i) {
            if (code == mc.mapConfig.ServiceLayers[i].code && mc.mapConfig.ServiceLayers[i].type === 'wms') {
                return mc.mapConfig.ServiceLayers[i]