派生自 wuyushui/SewerAndRainNetwork

wangrui
2020-12-22 47db5ff33fbb9df546b24759d52699a68fd4e841
修改底图错位的问题。
5个文件已修改
44 ■■■■■ 已修改文件
.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Sgis.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/helpers/ServiceLayerHelper.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/MapConfig.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.DS_Store
Binary files differ
package.json
@@ -16,7 +16,7 @@
    "element-ui": "^2.14.1",
    "jquery": "^3.5.1",
    "js-cookie": "^2.2.0",
    "leaflet": "^1.6.0",
    "leaflet": "^1.7.1",
    "leaflet-canvas-marker": "^0.2.0",
    "leaflet.markercluster": "^1.4.1",
    "lodash": "^4.17.10",
src/Sgis.js
@@ -31,6 +31,10 @@
    map = L.map(div, MapConfig.mapOptions)
    map.on('click', (event, a, b) => {
        console.log(event, a, b)
    })
    window.map = map
    window.L = L
src/components/helpers/ServiceLayerHelper.js
@@ -101,7 +101,10 @@
            this.tileLayersArray.push(layer)
        }
    }
    /**
     * 隐藏服务图层
     * @param {*} name
     */
    hideTileLayer(name){
        if(this.tileLayersMap){
            let tileLayer = this.tileLayersMap.get(name)
@@ -109,6 +112,9 @@
        }
    }
    /**
     * 获取所有的服务图层
     */
    getTileLayers(){
        return this.tilelayersArray
    }
src/conf/MapConfig.js
@@ -22,6 +22,8 @@
    maxZoom: 18,
    center: [26, 104],
    zoom: 3,
    worldCopyJump: true,
    inertia: true,
    zoomControl: false,
    attributionControl: false,
    editable: true
@@ -41,11 +43,12 @@
                visible: false,
                layerType: 'img_c',
                isLoadMapByToken: true,
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-image-globe/WMTS',
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-image-globe/WMTS?'+
                'layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}',
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
            annotation: {
@@ -54,11 +57,12 @@
                visible: false,
                layerType: 'cia_c',
                isLoadMapByToken: true,
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-image/WMTS',
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-image/WMTS?'+
                'layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}',
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
        },
@@ -72,11 +76,12 @@
                visible: false,
                layerType: 'vec_c',
                isLoadMapByToken: true,
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-vector-globe/WMTS',
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-vector-globe/WMTS?'+
                'layer=vec&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}',
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
            annotation: {
@@ -85,11 +90,12 @@
                visible: false,
                layerType: 'cva_c',
                isLoadMapByToken: true,
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-vector/WMTS',
                url: SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-vector/WMTS?'+
                'layer=cva&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}',
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            }
        }
@@ -111,7 +117,7 @@
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
            annotation: {
@@ -126,7 +132,7 @@
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
        },
@@ -146,7 +152,7 @@
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            },
            annotation: {
@@ -161,7 +167,7 @@
                option:{
                    maxZoom: 18,
                    minZoom: 1,
                    zoomOffset: 0
                    zoomOffset: 1
                }
            }
        }