派生自 wuyushui/SewerAndRainNetwork

seatonwan9
2021-05-12 3d7c359a73da1e5d796642d35be0e2444d997041
src/components/LayerController/logic/PipeLineAnimal.js
@@ -7,24 +7,29 @@
module.exports = function () {
  this.init = () => {
  }
  this.start = () => {
    const layers = LayerPipeLines.layers
    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) {
            var newStyles = Object.assign(STYLES, styles)
            layer.setStyle({
              fill: STYLES.FILL,
              weight: STYLES.WEIGHT,
              fillColor: STYLES.FILL_COLOR,
              color: STYLES.COLOR,
              fillOpacity: STYLES.FILL_OPACITY,
              opacity: STYLES.OPACITY,
              dashArray: STYLES.DASH_ARRAY,
              dashSpeed: STYLES.DASH_SPPED
              fill: newStyles.FILL,
              weight: newStyles.WEIGHT,
              fillColor: newStyles.FILL_COLOR,
              color: newStyles.COLOR,
              fillOpacity: newStyles.FILL_OPACITY,
              opacity: newStyles.OPACITY,
              dashArray: newStyles.DASH_ARRAY,
              dashSpeed: newStyles.DASH_SPPED
            })
          })
          // 重新添加到地图上,动画才有效果
@@ -33,43 +38,29 @@
        }
      }
    }
    /* window.$layer.iframe({
      content: {
        content: publicBounced,
        parent: this,
        data: {
          info: this.info,
          fn: () => {
            alert(1)
          }
        }
      },
      area: ['901px', '101px'],
      title: '这是一个标题这是一个标题这是一个标题这是一个标题',
      maxmin: true,
      shade: false,
      shadeClose: false,
      scrollbar: false,
      resize: true,
      btn: ['a', 'b'],
      cancel: () => {
        alert(2110)
      }
    }) */
  }
  this.destory = () => {
    console.log('destory!!!')
    const layers = LayerPipeLines.layers
    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
            })
          })
        }
      }