From e1cd733f46c68c7063345d27cb6481ce48ef0f6e Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Fri, 19 Sep 2025 17:46:13 +0800
Subject: [PATCH] feat:调整高度

---
 src/views/resource/components/spotDetails.vue |   73 +++++++++++++++++++++++++++---------
 1 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/src/views/resource/components/spotDetails.vue b/src/views/resource/components/spotDetails.vue
index abe7f5b..57ae968 100644
--- a/src/views/resource/components/spotDetails.vue
+++ b/src/views/resource/components/spotDetails.vue
@@ -399,14 +399,55 @@
 }
 
 // 更新上一个和这一个信息
+// function updateMapSpotInfo(nowEntity) {
+//   const nowData = nowEntity.customInfo;
+//   if (!nowEntity) return;
+//   if (nowEntity.customInfo.id === lastEntity?.customInfo.id) return;
+//   // 设置新的
+//   nowEntity.polygon.material = Cesium.Color.RED.withAlpha(0);
+//   nowEntity.polyline.material = Cesium.Color.RED;
+//   // 重置上一个
+//   if (lastEntity) {
+//     const lastData = lastEntity.customInfo;
+//     const originalFillColor =
+//       lastData.is_exception === 2
+//         ? Cesium.Color.RED.withAlpha(0.5)
+//         : Cesium.Color.YELLOW.withAlpha(0.5);
+//     const originalOutlineColor =
+//       lastData.is_exception == 2 ? Cesium.Color.RED : Cesium.Color.YELLOW;
+
+//     lastEntity.polygon.material = originalFillColor;
+//     lastEntity.polygon.outlineColor = originalOutlineColor;
+//     lastEntity.polyline.material = originalOutlineColor;
+//   }
+//   lastEntity = nowEntity;
+//   const numbersWithCommas = nowData.dkfw.match(/\d+(\.\d+)?/g);
+//   if (numbersWithCommas) {
+//     // 解析经纬度数组
+//     const groupedArr = numbersWithCommas.reduce((acc, val, index, src) => {
+//       if (index % 2 === 0) acc.push(src.slice(index, index + 2));
+//       return acc;
+//     }, []);
+
+//     const polygonCenter = getCenterPoint(groupedArr);
+//     // 相机定位
+//     homeViewer.value.scene.camera.setView({
+//       destination: Cesium.Cartesian3.fromDegrees(
+//         Number(polygonCenter.lng),
+//         Number(polygonCenter.lat),
+//         1500
+//       ),
+ 
+//     });
+//   }
+
+// }
 function updateMapSpotInfo(nowEntity) {
   const nowData = nowEntity.customInfo;
   if (!nowEntity) return;
   if (nowEntity.customInfo.id === lastEntity?.customInfo.id) return;
-  // 设置新的
   nowEntity.polygon.material = Cesium.Color.RED.withAlpha(0);
   nowEntity.polyline.material = Cesium.Color.RED;
-  // 重置上一个
   if (lastEntity) {
     const lastData = lastEntity.customInfo;
     const originalFillColor =
@@ -415,7 +456,6 @@
         : Cesium.Color.YELLOW.withAlpha(0.5);
     const originalOutlineColor =
       lastData.is_exception == 2 ? Cesium.Color.RED : Cesium.Color.YELLOW;
-
     lastEntity.polygon.material = originalFillColor;
     lastEntity.polygon.outlineColor = originalOutlineColor;
     lastEntity.polyline.material = originalOutlineColor;
@@ -423,23 +463,20 @@
   lastEntity = nowEntity;
   const numbersWithCommas = nowData.dkfw.match(/\d+(\.\d+)?/g);
   if (numbersWithCommas) {
-    // 解析经纬度数组
-    const groupedArr = numbersWithCommas.reduce((acc, val, index, src) => {
-      if (index % 2 === 0) acc.push(src.slice(index, index + 2));
-      return acc;
-    }, []);
-    const polygonCenter = getCenterPoint(groupedArr);
-    // 相机定位
-    homeViewer.value.scene.camera.setView({
-      destination: Cesium.Cartesian3.fromDegrees(
-        Number(polygonCenter.lng),
-        Number(polygonCenter.lat),
-        1500
-      ),
- 
+
+    const positionsData = [];
+    for (let i = 0; i < numbersWithCommas.length; i += 2) {
+      const lon = Number(numbersWithCommas[i]);
+      const lat = Number(numbersWithCommas[i + 1]);
+      positionsData.push([lon, lat, 10]); 
+    }
+    flyVisual({
+      positionsData: positionsData, 
+      viewer: homeViewer.value,     
+      multiple: 15,                  
+      // pitch: -90                    
     });
   }
-
 }
 // 清空选中的数据
 const clearSelect = () => {

--
Gitblit v1.9.3