From 47db5ff33fbb9df546b24759d52699a68fd4e841 Mon Sep 17 00:00:00 2001 From: wangrui <zephyrs0894@163.com> Date: 星期二, 22 十二月 2020 18:01:18 +0800 Subject: [PATCH] 修改底图错位的问题。 --- src/views/MapTemplate.vue | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index a441c66..9dfea6c 100644 --- a/src/views/MapTemplate.vue +++ b/src/views/MapTemplate.vue @@ -9,6 +9,7 @@ <script> import 'leaflet/dist/leaflet.css' import Sgis from '@src/Sgis' +import mapConfig from '@/conf/MapConfig' import SgisLayerController from '@components/LayerController/LayerController' import MonitorPanel from '@components/panel/MonitorPanel' import { mapMutations, mapState } from 'vuex' @@ -32,9 +33,17 @@ init() { const mapcontainer = this.$refs.rootmap this.mapObj = Sgis.initMap(mapcontainer) - this.basemapHelper = Sgis.initBasemaps(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栧簳鍥� - this.serviceLayerHelper = Sgis.initTileLayers(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栧簳鍥� - this.vectorLayerHelper = Sgis.initVectorLayers(this.mapObj.map, this.mapObj.L, {}) // 鍒濆鍖栦笟鍔″浘灞� + + this.basemapHelper = Sgis.initBasemapsHelper(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栧熀纭�搴曞浘鍔╂墜 + this.basemapHelper.initBasemap(mapConfig, false) // 绗簩涓弬鏁帮紝琛ㄧず鏄惁鍐呯綉搴曞浘 + + + this.serviceLayerHelper = Sgis.initTileLayersHelper(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栦笟鍔″簳鍥惧姪鎵� + this.serviceLayerHelper.initServiceLayers(mapConfig) + + this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栧姩鎬佽绱犲浘灞傚姪鎵� + this.vectorLayerHelper.initVectorLayers(mapConfig) + this.setLayerHelper(this.vectorLayerHelper) return this.map } -- Gitblit v1.8.0