From f41e347a34d2859c149c59691bda6d179b209d44 Mon Sep 17 00:00:00 2001
From: yxl <584911253@qq.com>
Date: 星期三, 22 一月 2025 17:42:53 +0800
Subject: [PATCH] 最新修改

---
 src/assets/js/mapSetFunc.js |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/src/assets/js/mapSetFunc.js b/src/assets/js/mapSetFunc.js
index 7b8c046..53959f6 100644
--- a/src/assets/js/mapSetFunc.js
+++ b/src/assets/js/mapSetFunc.js
@@ -28,6 +28,9 @@
       case "getParam":
         this.addTetrahedron(res);
         break;
+      case "attackentity":
+        this.addPolyLine(res);
+        break;
     }
   },
   creatQueryMeta(res) {
@@ -476,6 +479,41 @@
     });
   },
 
+  //缁樺埗绾�
+  addPolyLine(res) {
+    // 瑙f瀽 LINESTRING 瀛楃涓蹭负缁忕含搴﹀潗鏍囨暟缁�
+    const coordinates = res.bombpoint
+      .replace("LINESTRING", "") // 鍘婚櫎 'LINESTRING' 閮ㄥ垎
+      .replace(/[()]/g, "") // 鍘婚櫎鎷彿
+      .split(",") // 鎸夐�楀彿鍒嗗壊
+      .map(coord => {
+        const [lon, lat] = coord.trim().split(" "); // 灏嗘瘡瀵瑰潗鏍囧垎寮�
+        return [parseFloat(lon), parseFloat(lat)]; // 杞崲涓烘暟瀛�
+      });
+    const positions = coordinates.map(coord => {
+      return {
+        x: coord[0],
+        y: coord[1],
+        z: 21
+      };
+    });
+    positions.forEach((item,index) => {
+      const particle = earthCtrl.factory.createParticleEffect("flame", item, {
+        translation: SmartEarth.Cesium.Cartesian3.fromElements(0, 0, 0), //骞崇Щ
+        emissionRate: 500,
+        startScale: 15,
+        endScale: 45,
+      });
+      if (index == positions.length/2) {
+        earthCtrl.camera.flyTo(item.x, item.y, 3000, 0, -90, 0, 2);
+      }
+      this.layerList.push({
+        layer: particle,
+        func: 'attackentity'
+      });
+    })
+  },
+
   removeAll() {
     store.state.setListColor = [];
     store.state.showLenged = false;
@@ -528,6 +566,11 @@
         this.layerList.splice(i, 1);
         i--;
       }
+      else if (obj.func == "attackentity") {
+        this.layerList[i].layer.deleteObject();
+        this.layerList.splice(i, 1);
+        i--;
+      }
     }
     if (!window.terrain) {
       window.terrain = earthCtrl.factory.createTerrainLayer({

--
Gitblit v1.9.3