From 4f210560973162685449e99ece819a1aad190db1 Mon Sep 17 00:00:00 2001
From: seatonwan9 <seatonwan9@163.com>
Date: 星期二, 20 四月 2021 14:12:16 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
---
src/components/LayerController/service/WfsLayerService.js | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/components/LayerController/service/WfsLayerService.js b/src/components/LayerController/service/WfsLayerService.js
index b263e46..cb0a4bf 100644
--- a/src/components/LayerController/service/WfsLayerService.js
+++ b/src/components/LayerController/service/WfsLayerService.js
@@ -1,9 +1,9 @@
/**
* 鍔犺浇涓氬姟鏁版嵁鍥惧眰
*/
-
import { STYLES } from '../../../conf/Constants'
import AjaxUtils from '../../../utils/AjaxUtils'
+import { setZIndex } from '../../../utils/utils'
class WfsLayerService {
constructor (config) {
@@ -11,8 +11,8 @@
this.params = {
version: '1.0.0',
REQUEST: 'getfeature',
- OUTPUTFORMAT: 'json',
- maxFeatures: 20000
+ OUTPUTFORMAT: 'json'
+ // maxFeatures: 20000
}
this.popupComp = window.popupComp
this.L = window.L
@@ -30,14 +30,15 @@
loadData (wfsUrl) {
AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => {
- console.log(res)
this.draw(res.data.features)
})
}
draw (features) {
const icon = this.config.icon
- this.L.geoJSON(features, {
+ const styles = this.config.styles
+ Object.assign(STYLES, styles)
+ const geojsonLayer = this.L.geoJSON(features, {
style: function (feature) {
return {
fill: STYLES.FILL,
@@ -75,6 +76,7 @@
.on('mouseover', (e) => this.mouseOverListener(e, layer)).on('mouseout', (e) => this.mouseOutListener(e, layer))
}
}).addTo(this.layer)
+ setZIndex(geojsonLayer)
}
mouseOverListener (e, layer) {
--
Gitblit v1.8.0