From 1bbd2b05db1860bfa44acc57f27db507be974f16 Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期二, 02 三月 2021 15:35:55 +0800
Subject: [PATCH] 修改图层控制
---
src/components/helpers/ServiceLayerHelper.js | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/components/helpers/ServiceLayerHelper.js b/src/components/helpers/ServiceLayerHelper.js
index 96ad647..e3a1af7 100644
--- a/src/components/helpers/ServiceLayerHelper.js
+++ b/src/components/helpers/ServiceLayerHelper.js
@@ -17,6 +17,7 @@
this.geojsonArray = {} // 鍒濆鐨刧eojson闆�
this.layerConfig = {}
this.regex = /\{(.+?)\}/g // 鍖归厤{}
+ this.popupComp = null
}
getTileLayer (code) {
@@ -26,10 +27,11 @@
/**
* 鏍规嵁閰嶇疆鏂囦欢鍒濆鍖栦笟鍔″簳鍥�
*/
- initServiceLayers (layerConfig) {
+ initServiceLayers (layerConfig, popupComp) {
this.layerConfig = layerConfig
+ this.popupComp = popupComp
this.loadLayers(layerConfig.mapConfig.Layers.LayerSewersLine)
- // this.loadLayers(layerConfig.mapConfig.Layers.layerSewersPoint)
+ this.loadLayers(layerConfig.mapConfig.Layers.layerSewersPoint)
}
/**
@@ -116,6 +118,14 @@
})
}
}).bindPopup(function (layer) {
+ that.popupComp.setDatas(layer)
+ that.popupComp.setShow()
+ return that.popupComp.$el
+ }, {
+ className: 's-map-popup',
+ minWidth: 300,
+ closeButton: false,
+ autoClose: false
}).addTo(featureGroup).bringToFront()
return featureGroup
}
--
Gitblit v1.8.0