派生自 wuyushui/SewerAndRainNetwork

chenyibo
2021-03-30 1250621ab9ea6ea93911be0f283c3bfcdceb0667
src/components/LayerController/service/WfsLayerService.js
@@ -21,15 +21,20 @@
  }
  init (layer) {
    this.layer = layer
    const wfsUrl = this.config.wfs
    if (wfsUrl) {
      AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(layer, res.data.features))
      this.loadData(wfsUrl)
    }
  }
  draw (layer, features) {
  loadData (wfsUrl) {
    AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(res.data.features))
  }
  draw (features) {
    const icon = this.config.icon
    const geojson = this.L.geoJSON(features, {
    this.L.geoJSON(features, {
      style: function (feature) {
        return {
          fill: styles.defaultLineStyle.fill,
@@ -66,8 +71,7 @@
          .bindTooltip((layer) => this.tooltipListener(layer), { direction: 'bottom', offset: [0, 15], sticky: true })
          .on('mouseover', (e) => this.mouseOverListener(e, layer)).on('mouseout', (e) => this.mouseOutListener(e, layer))
      }
    }).addTo(layer)
    return geojson
    }).addTo(this.layer)
  }
  mouseOverListener (e, layer) {