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 |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/components/LayerController/service/WfsLayerService.js b/src/components/LayerController/service/WfsLayerService.js
index 7f10aee..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
@@ -29,12 +29,16 @@
   }
 
   loadData (wfsUrl) {
-    AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(res.data.features))
+    AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (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,
@@ -42,9 +46,9 @@
           fillColor: STYLES.FILL_COLOR,
           color: STYLES.COLOR,
           fillOpacity: STYLES.FILL_OPACITY,
-          opacity: STYLES.OPACITY,
-          dashArray: STYLES.DASH_ARRAY,
-          dashSpeed: STYLES.DASH_SPPED
+          opacity: STYLES.OPACITY
+          // dashArray: STYLES.DASH_ARRAY,
+          // dashSpeed: STYLES.DASH_SPPED
         }
       },
       pointToLayer: (geoJsonPoint, latlng) => {
@@ -72,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