派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-03-10 b839ef68a65fdc9a3b00ce0855c97679aec10d1d
src/components/helpers/ServiceLayerHelper.js
@@ -143,7 +143,8 @@
  loadGeojson (res, opt) {
    var that = this
    var icon = opt.icon
    const layergroup = that.L.featureGroup().addTo(that.map)
    const featureGroup = that.L.featureGroup().addTo(that.map)
    const featureList = []
    const geojson = that.L.geoJSON(res.features, {
      style: function (feature) {
        return {
@@ -152,9 +153,9 @@
          fillColor: styles.defaultLineStyle.fillColor,
          color: styles.defaultLineStyle.color,
          fillOpacity: styles.defaultLineStyle.fillOpacity,
          opacity: styles.defaultLineStyle.opacity
          // dashArray: styles.defaultLineStyle.dashArray,
          // dashSpeed: styles.defaultLineStyle.dashSpeed
          opacity: styles.defaultLineStyle.opacity,
          dashArray: styles.defaultLineStyle.dashArray,
          dashSpeed: styles.defaultLineStyle.dashSpeed
        }
      },
      pointToLayer: function (geoJsonPoint, latlng) {
@@ -166,6 +167,10 @@
              size: styles.defaultLineStyle.size
            }
          })
      },
      onEachFeature: function (feature, layer) {
        featureList.push(layer)
        layer.addTo(featureGroup)
      }
    }).bindPopup(function (layer) {
      that.popupComp.setDatas(layer)
@@ -220,7 +225,8 @@
          })
        }
      // }).addTo(that.map)
      }).addTo(layergroup)
      // }).addTo(featureGroup)
      })
    store.commit('addSewersDatas', geojson)
    if (Object.prototype.hasOwnProperty.call(res, 'features') && res.features.length > 0 && (res.features[0].geometry.type === 'LineString' || res.features[0].geometry.type === 'MultiLineString')) {
      geojson.bringToBack()