From 72e8ced67fe06adf794678a03d95bc1eb0947d4e Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期四, 15 四月 2021 17:34:05 +0800
Subject: [PATCH] 弹框组件初步,管线动画控制,默认值修改

---
 src/components/LayerController/logic/PipeLineAnimal.js |   82 +++++++++++++++++++++++++++++++++--------
 1 files changed, 66 insertions(+), 16 deletions(-)

diff --git a/src/components/LayerController/logic/PipeLineAnimal.js b/src/components/LayerController/logic/PipeLineAnimal.js
index 585147b..f712d96 100644
--- a/src/components/LayerController/logic/PipeLineAnimal.js
+++ b/src/components/LayerController/logic/PipeLineAnimal.js
@@ -1,28 +1,78 @@
+
 /**
  *  绠$嚎鍔ㄧ敾鎺у埗閫昏緫
  */
-const layerPipeLines = require('../../../conf/layers/LayerPipeLines').LayerPipeLines
+const LayerPipeLines = require('../../../conf/layers/LayerPipeLines').LayerPipeLines
+const STYLES = require('../../../conf/Constants').STYLES
 
 module.exports = function () {
-  this.init = (layer, L) => {
-    console.log('sssssss')
-    const layers = layerPipeLines.layers
+  this.init = () => {
+    const layers = LayerPipeLines.layers
     for (var i = 0; i < layers.length; i++) {
       const config = layers[i]
       const code = config.code
+      // window.layerFactory.show(config)
       const layer = window.layerFactory.layers[code]
-      layer.setStyle({
-        FILL: true,
-        WEIGHT: 3,
-        FILL_COLOR: '#73b2ff',
-        COLOR: '#73b2ff',
-        FILL_OPACITY: 0.2,
-        OPACITY: 1,
-        DASH_ARRAY: '4,4',
-        DASH_SPPED: -5,
-        ICON_SIZE: [10, 10]
-      })
-      console.log(layer)
+      if (layer) {
+        if (layer.eachLayer) {
+          layer.eachLayer(function (layer) {
+            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
+            })
+          })
+          // 閲嶆柊娣诲姞鍒板湴鍥句笂锛屽姩鐢绘墠鏈夋晥鏋�
+          window.map.removeLayer(layer)
+          window.layerFactory.show(config)
+        }
+      }
+    }
+    /* 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
+      // window.layerFactory.show(config)
+      const layer = window.layerFactory.layers[code]
+      if (layer) {
+        if (layer.eachLayer) {
+          layer.eachLayer(function (layer) {
+            layer.resetStyle()
+          })
+        }
+      }
     }
   }
 }

--
Gitblit v1.8.0