派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-14 57b93c75dac23bd9b4c8400d32169eaef62414d5
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,7 +80,7 @@
    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 () {
@@ -92,6 +92,7 @@
      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,
@@ -102,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
          /**
           * {