From b27e031827eae0f535d17bb20ff4809699151a17 Mon Sep 17 00:00:00 2001
From: YANGDL <114714267@qq.com>
Date: 星期一, 08 二月 2021 15:42:37 +0800
Subject: [PATCH] 修改了leaflet L加载模式 修改了使用less加载方式
---
src/components/helpers/ServiceLayerHelper.js | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/components/helpers/ServiceLayerHelper.js b/src/components/helpers/ServiceLayerHelper.js
index 21d9aca..c85d32b 100644
--- a/src/components/helpers/ServiceLayerHelper.js
+++ b/src/components/helpers/ServiceLayerHelper.js
@@ -2,15 +2,14 @@
/**
* 鍒涘缓鍥惧眰鐩稿叧鐨勭被
*/
-import L from 'leaflet'
class ServiceLayerHelper {
constructor (options) {
this.map = options.map
- this.L = options.L
+ this.L = window.L
this.tileLayersMap = new Map()
this.tileLayersWMSArray = []
- this.tileLayerWmslayerGroup = L.layerGroup().addTo(this.map)
+ this.tileLayerWmslayerGroup = this.L.layerGroup().addTo(this.map)
this.tileLayersWMTSArray = []
this.tileLayersTileArray = []
this.mapConfig = {}
@@ -89,7 +88,7 @@
layers: options.layers || 'all', // country
format: options.format || 'image/png',
transparent: options.true || true,
- crs: options.crs || L.CRS.EPSG4326,
+ crs: options.crs || this.L.CRS.EPSG4326,
maxZoom: options.maxZoom || 21,
minZoom: options.minZoom || 1,
zoomOffset: options.zoomOffset || 0
--
Gitblit v1.8.0