From 450711590fdd4e70c7741c05bea7f96a997fab7d Mon Sep 17 00:00:00 2001
From: chenyabin <Chenab123!>
Date: 星期二, 18 五月 2021 10:10:16 +0800
Subject: [PATCH] 应急面板

---
 src/components/LayerController/service/WmsLayerService.js |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/components/LayerController/service/WmsLayerService.js b/src/components/LayerController/service/WmsLayerService.js
index 999783e..fbc74bd 100644
--- a/src/components/LayerController/service/WmsLayerService.js
+++ b/src/components/LayerController/service/WmsLayerService.js
@@ -1,5 +1,5 @@
 import AjaxUtils from '../../../utils/AjaxUtils'
-import { PIPELINE_WMS } from '../../../conf/Constants'
+import { WMS_URL } from '../../../conf/Constants'
 import Popup from '@views/popup/Popup'
 import WmsLayerList from '../dataset/WmsLayerList'
 
@@ -80,17 +80,19 @@
     if (filter.length > 0) {
       params.cql_filter = filter
     }
-    this.wmsLayer = this.L.tileLayer.wms(PIPELINE_WMS, params).addTo(this.map)
+    this.wmsLayer = this.L.tileLayer.wms(WMS_URL, params).addTo(this.map)
   }
 
   clickListener () {
     window.map.on('click', (e) => {
-      console.log(e)
+      // console.log(e)
+      window.layerFactory.clearHighlight()
       this.featureGroup.clearLayers()
       var point = this.map.latLngToContainerPoint(e.latlng, this.map.getZoom())
       var size = this.map.getSize()
       // const bbox = this.L.latLngBounds(this.L.latLng(e.latlng.lng, e.latlng.lat)).toBBoxString()
       const layers = this.wmsLayerList.getLayers()
+      const filter = this.wmsLayerList.getFilters()
       if (layers.length > 0) {
         const params = Object.assign({
           LAYERS: layers,
@@ -101,7 +103,10 @@
           Y: Math.round(point.y),
           BBOX: this.map.getBounds().toBBoxString()
         }, this.params)
-        AjaxUtils.get4JsonDataByUrl(PIPELINE_WMS, params, (res) => {
+        if (filter.length > 0) {
+          params.cql_filter = filter
+        }
+        AjaxUtils.get4JsonDataByUrl(WMS_URL, params, (res) => {
           const features = res.data.features
           /**
            * {

--
Gitblit v1.8.0