From 47db5ff33fbb9df546b24759d52699a68fd4e841 Mon Sep 17 00:00:00 2001
From: wangrui <zephyrs0894@163.com>
Date: 星期二, 22 十二月 2020 18:01:18 +0800
Subject: [PATCH] 修改底图错位的问题。

---
 src/conf/MapConfig.js |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js
index 731f76d..cf8d3d0 100644
--- a/src/conf/MapConfig.js
+++ b/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
                 }
             }
         }

--
Gitblit v1.8.0