From 4adfa4774e09f3b388335bb8dee5dea518856e5b Mon Sep 17 00:00:00 2001
From: yangdelong <828900aaa>
Date: 星期日, 30 五月 2021 19:23:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/develop' into develop

---
 src/utils/utils.js |   46 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 2328fd0..c187b1c 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -27,15 +27,15 @@
  * 鑴夊啿鏁堟灉
  */
 export function pulseEffect (xy) {
-  let times = 5
-  const colors = ['#98FB98', '#ff0000']
+  let times = 1000
+  const colors = ['#00f100', '#ff0000']
   // 鎻掍欢 鏁堟灉瀹炵幇
   var pulsingIcon = window.L.icon.pulse({
-    iconSize: [20, 20],
+    iconSize: [30, 30],
     color: colors[0],
     fillColor: ''
   })
-  var picGroupMarker = window.L.marker(xy, { icon: pulsingIcon }).addTo(window.map)
+  var picGroupMarker = window.L.marker(xy, { icon: pulsingIcon }).addTo(window.mapManager.hightlightLayer)
   // 瀹氭椂
   var timeInterval = setInterval(() => {
     if (times > 0) {
@@ -45,6 +45,35 @@
       picGroupMarker.remove()
     }
   }, 1000)
+}
+
+export function reversePolyLine (feature) {
+  const coordinates = clone(feature.geometry.coordinates)
+  var latlng = []
+  for (var j = 0; j < coordinates.length; j++) {
+    let coordinate = coordinates[j]
+    coordinate = [coordinate[1], coordinate[0]]
+    latlng.push(coordinate)
+  }
+  return latlng
+}
+
+export function reverseMultiLine (feature) {
+  const coordinates = clone(feature.geometry.coordinates)
+  var latlng = []
+  for (var j = 0; j < coordinates.length; j++) {
+    const coordinate = coordinates[j]
+    var xy = []
+    for (var k = 0; k < coordinate.length; k++) {
+      let coor = coordinate[k]
+      if (coor.length > 2) {
+        coor = coor.splice(2, 1)
+      }
+      xy.push(coor.reverse())
+    }
+    latlng.push(xy)
+  }
+  return latlng
 }
 
 /**
@@ -116,4 +145,13 @@
   }
 }
 
+/**
+ * 鍘绘帀涓ゅご绌烘牸
+ * @param str
+ * @returns {*}
+ */
+export function lrtrim (str) {
+  return str.replace(/^\s+|\s+$/g, '')
+}
+
 export default clone

--
Gitblit v1.8.0