Ver código fonte

冲突处理

Koishi 1 semana atrás
pai
commit
a2491a4832

+ 2 - 2
src/App.vue

@@ -1,9 +1,9 @@
 <template>
     <!-- <menuCom /> -->
-    <div class="header">
+    <!-- <div class="header">
         <img :src="cesiumImg" alt="">
         <p>“天镜” 数字孪生可视化引擎</p>
-    </div>
+    </div> -->
 
     <RouterView />
 </template>

+ 10 - 0
src/views/cesium.vue

@@ -1696,6 +1696,16 @@ export default {
           horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
           // 模型贴地
           heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+
+          rotation: e.energytype === "Wind" ? new Cesium.CallbackProperty(function (time) {
+            // 每 3 秒转一圈(可调速度)
+            const seconds = time.secondsOfDay;
+            const angle = Cesium.Math.toRadians(((seconds % 3) * -360) / 3); // 每3秒一圈
+            return angle;
+          }, false) : null,
+          // 确保绕中心旋转
+          rotationAlignment: Cesium.HeightReference.CENTER,
+          alignedAxis: Cesium.Cartesian3.UNIT_Z,
         },
         // name: 'video_entity',
         label: {

+ 26 - 25
src/views/cesiumComponents/windMap2D.vue

@@ -221,7 +221,8 @@ export default {
         // minimumLevel: 11,
         maximumLevel: 18,
         // url: this.urlTiles,
-        url: "/static/ditu/{z}/{x}/{y}.png",
+        // url: "/static/ditu/{z}/{x}/{y}.png",
+        url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
         credit: "影像地图",
       });
       imageryProvider.alpha = 0.55; // 透明度
@@ -462,24 +463,24 @@ export default {
 
       console.log("statusItems====>>>>", statusItems);
 
-      const billboardImage = advancedGenerator.generateAdvancedBillboard({
-        title: val.name,
-        statusItems,
-        borderGradient: ["#00e5ff", "#2979ff"],
-      });
-
-      const entityxy = viewer.entities.add({
-        name: val.name,
-        position,
-        billboard: {
-          image: billboardImage,
-          scale: 1,
-          verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 原来已经是CENTER,现在改为BOTTOM
-          pixelOffset: new Cesium.Cartesian2(80, -50), // 原来是-20,现在改为30,向上移动
-          eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
-          heightReference: Cesium.HeightReference.NONE,
-        },
-      });
+    //   const billboardImage = advancedGenerator.generateAdvancedBillboard({
+    //     title: val.name,
+    //     statusItems,
+    //     borderGradient: ["#00e5ff", "#2979ff"],
+    //   });
+
+    //   const entityxy = viewer.entities.add({
+    //     name: val.name,
+    //     position,
+    //     billboard: {
+    //       image: billboardImage,
+    //       scale: 1,
+    //       verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 原来已经是CENTER,现在改为BOTTOM
+    //       pixelOffset: new Cesium.Cartesian2(80, -50), // 原来是-20,现在改为30,向上移动
+    //       eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
+    //     //   heightReference: Cesium.HeightReference.NONE,
+    //     },
+    //   });
 
       const btn = document.getElementById("windBtn");
 
@@ -496,7 +497,7 @@ export default {
           verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
           horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
           // 模型贴地
-          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+        //   heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
         },
         // label: {
         //     // text: val.name ? val.name : val.plantname,
@@ -548,7 +549,7 @@ export default {
           verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
           horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
           // 模型贴地
-          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+        //   heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
           // 核心:使用 CallbackProperty 实现旋转动画
           rotation: new Cesium.CallbackProperty(function (time) {
             // 每 3 秒转一圈(可调速度)
@@ -867,11 +868,11 @@ export default {
           targetLat = it.latitude;
         }
       });
-      const targetHeight = 20000;
+      const targetHeight = 5000;
 
-      const draggableHeightTolerance = 10000; // 允许拖拽的高度范围:20,000 ~ 30,000
-      const minHeight = 10000; // 最低高度
-      const maxHeight = 800000; // 最高高度
+      const draggableHeightTolerance = 5000; // 允许拖拽的高度范围:20,000 ~ 30,000
+      const minHeight = 5000; // 最低高度
+      const maxHeight = 10000; // 最高高度
 
       const allowedOffsetDegrees = 0.2; // 允许拖拽的最大偏移(经纬度)
 

+ 7 - 9
src/views/cesiumComponents/windView.vue

@@ -1290,17 +1290,15 @@ export default {
   position: absolute;
   left: 20px;
 }
-.btnms1 {
-  width: 80px;
-  left: 20px;
+.btnms1{
+    left: 20px;
 }
-.btnms2 {
-  width: 120px;
-  left: 120px;
+.btnms2{
+    left: 90px;
 }
 .sidebar-left-top {
-  top: 100px;
-  padding: 5px;
+  top: 110px;
+  padding: 5px 15px;
   border-radius: 8px;
   backdrop-filter: blur(10px);
   border: 1px solid rgba(255, 255, 255, 0.2);
@@ -1315,7 +1313,7 @@ export default {
   text-align: center;
   cursor: pointer;
   .label {
-    font-size: 20px;
+    font-size: 16px;
     color: #fff;
   }
 }