派生自 wuyushui/SewerAndRainNetwork

seatonwan9
2021-04-20 4f210560973162685449e99ece819a1aad190db1
src/components/LayerController/logic/PipeLineAnimal.js
@@ -7,6 +7,9 @@
module.exports = function () {
  this.init = () => {
  }
  this.create = () => {
    const layers = LayerPipeLines.layers
    for (var i = 0; i < layers.length; i++) {
      const config = layers[i]
@@ -42,12 +45,22 @@
    for (var i = 0; i < layers.length; i++) {
      const config = layers[i]
      const code = config.code
      const styles = config.styles
      // window.layerFactory.show(config)
      const layer = window.layerFactory.layers[code]
      if (layer) {
        if (layer.eachLayer) {
          layer.eachLayer(function (layer) {
            layer.resetStyle()
            var newStyles = Object.assign(STYLES, styles)
            layer.setStyle({
              fill: newStyles.FILL,
              weight: newStyles.WEIGHT,
              fillColor: newStyles.FILL_COLOR,
              color: newStyles.COLOR,
              fillOpacity: newStyles.FILL_OPACITY,
              opacity: newStyles.OPACITY
            })
          })
        }
      }