From b59fe688dd6034cf3080889c15113dff052fbabb Mon Sep 17 00:00:00 2001
From: wangrui <zephyrs0894@163.com>
Date: 星期二, 22 十二月 2020 10:46:46 +0800
Subject: [PATCH] 地图底图错位
---
src/main.js | 2 +-
src/conf/MapConfig.js | 16 ++++++++--------
src/components/helpers/BasemapHelper.js | 6 +++---
src/components/helpers/ServiceLayerHelper.js | 2 ++
4 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/components/helpers/BasemapHelper.js b/src/components/helpers/BasemapHelper.js
index b8700b1..a1d315b 100644
--- a/src/components/helpers/BasemapHelper.js
+++ b/src/components/helpers/BasemapHelper.js
@@ -18,9 +18,9 @@
* @param defBasemapName 鍒濆鍖栧畬鎴愬悗锛岄粯璁ゆ樉绀虹殑鍥惧眰
*/
initBasemap = (mapConfig, isIntranet) => {
- if(isIntranet) {
- this._getToken(mapConfig); // 鑾峰彇token锛屽苟鎸夐厤缃姞杞藉湴鍥�
- }else {
+ if(isIntranet) { // 鍐呯綉
+ this._getToken(mapConfig); // 鑾峰彇token鍚庯紝骞舵寜閰嶇疆鍔犺浇鍦板浘
+ }else { // 澶栫綉
this._createBasemapByConfig(mapConfig)
}
diff --git a/src/components/helpers/ServiceLayerHelper.js b/src/components/helpers/ServiceLayerHelper.js
index ad2939c..6d4ce8c 100644
--- a/src/components/helpers/ServiceLayerHelper.js
+++ b/src/components/helpers/ServiceLayerHelper.js
@@ -8,6 +8,7 @@
this.L = options.L
this.tileLayersMap = new Map()
this.tileLayersArray = []
+ this.mapConfig = {}
}
/**
@@ -15,6 +16,7 @@
*/
initServiceLayers(mapConfig){
console.log(mapConfig)
+ this.mapConfig = mapConfig
}
/**
diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js
index b41eec9..ffca88b 100644
--- a/src/conf/MapConfig.js
+++ b/src/conf/MapConfig.js
@@ -39,7 +39,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
annotation: {
@@ -52,7 +52,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
},
@@ -70,7 +70,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
annotation: {
@@ -83,7 +83,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
}
}
@@ -105,7 +105,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
annotation: {
@@ -120,7 +120,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
},
@@ -140,7 +140,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
},
annotation: {
@@ -155,7 +155,7 @@
option:{
maxZoom: 18,
minZoom: 1,
- zoomOffset: 1
+ zoomOffset: 0
}
}
}
diff --git a/src/main.js b/src/main.js
index 96479c7..18940fb 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,5 +1,5 @@
import Vue from 'vue'
-import App from './App.vue'
+import App from './App2.vue'
import router from './router'
import store from './store'
// import registerDirectives from './directive'
--
Gitblit v1.8.0