From f3ab28fd376caec5b142145d9b779d846f9fbc10 Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期一, 31 五月 2021 10:23:28 +0800
Subject: [PATCH] 企业应急-事件上报布局问题修改

---
 src/utils/utils.js |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 304c202..702b36c 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -27,7 +27,8 @@
  * 鑴夊啿鏁堟灉
  */
 export function pulseEffect (xy) {
-  let times = 50
+  window.mapManager.clearHighlight()
+  let times = 1000
   const colors = ['#00f100', '#ff0000']
   // 鎻掍欢 鏁堟灉瀹炵幇
   var pulsingIcon = window.L.icon.pulse({
@@ -48,23 +49,27 @@
 }
 
 export function reversePolyLine (feature) {
-  const coordinates = feature.geometry.coordinates
+  const coordinates = clone(feature.geometry.coordinates)
   var latlng = []
   for (var j = 0; j < coordinates.length; j++) {
-    const coordinate = coordinates[j]
-    latlng.push(coordinate.reverse())
+    let coordinate = coordinates[j]
+    coordinate = [coordinate[1], coordinate[0]]
+    latlng.push(coordinate)
   }
   return latlng
 }
 
 export function reverseMultiLine (feature) {
-  const coordinates = feature.geometry.coordinates
+  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++) {
-      const coor = coordinate[k]
+      let coor = coordinate[k]
+      if (coor.length > 2) {
+        coor = coor.splice(2, 1)
+      }
       xy.push(coor.reverse())
     }
     latlng.push(xy)
@@ -141,4 +146,13 @@
   }
 }
 
+/**
+ * 鍘绘帀涓ゅご绌烘牸
+ * @param str
+ * @returns {*}
+ */
+export function lrtrim (str) {
+  return str.replace(/^\s+|\s+$/g, '')
+}
+
 export default clone

--
Gitblit v1.8.0