xyh há 1 ano atrás
pai
commit
0c8f063fdc

BIN
src/assets/model/satelite1.glb


+ 1 - 1
src/layout/Footer/index.vue

@@ -12,7 +12,7 @@
        </div>
        <div style="margin-left: 300px;line-height: 31px;">
         <span style="margin: auto 30px;">经度: {{ mouseLocation.longitude }}</span>
-        <span style="margin: auto 30px;">度:{{ mouseLocation.latitude }}</span>
+        <span style="margin: auto 30px;">度:{{ mouseLocation.latitude }}</span>
         <span style="margin: auto 30px;">层级: {{ cameraHeightAndZoom.zoom }}</span>
         <span style="margin: auto 30px;">视高:{{ cameraHeightAndZoom.height }}</span>
        </div>

+ 5 - 12
src/views/simulation/index.vue

@@ -44,7 +44,7 @@ import screenfull from "screenfull";
 import fireController from "@/api/fireController.js";
 import { getToken } from "@/utils";
 import axios from "axios";
-import satelliteModel from '@/assets/model/satelite.glb';
+import satelliteModel from '@/assets/model/satelite1.glb';
 import TimeLine from '@/components/TimeLine/index.vue';
 import missileModel from '@/assets/model/basic_missle.glb';
 import thaadModel from '@/assets/model/anti-aircraft_gun_fire_control_radar_vehicle.glb';
@@ -690,7 +690,7 @@ export default {
         }
       });
     },
-    markSatelliteLine(position1, position2, color) {
+    markSatelliteLine(position1, position2, color,viewer) {
 
       // 创建一个带有箭头图标的PolylineMaterial
       const material = new this.Cesium.PolylineArrowMaterialProperty(
@@ -698,15 +698,7 @@ export default {
       );
 
       // 将点1和点2之间的连线添加到Viewer中
-      this.viewer2D.entities.add({
-        polyline: {
-          positions: [position1, position2],
-          width: 5, // 设置线的宽度
-          material: material,
-          followSurface: false // 设置为false,使连线保持在固定的高度,不会贴地显示
-        }
-      });
-      this.viewer3D.entities.add({
+      viewer.entities.add({
         polyline: {
           positions: [position1, position2],
           width: 5, // 设置线的宽度
@@ -714,6 +706,7 @@ export default {
           followSurface: false // 设置为false,使连线保持在固定的高度,不会贴地显示
         }
       });
+
     },
     setTimeLine(startTime, endtime, stepTime) {
       let start = this.Cesium.JulianDate.fromDate(new Date(startTime));  // 设置时间轴当前时间为开始时间
@@ -903,7 +896,7 @@ export default {
       entity.orientation = new this.Cesium.VelocityOrientationProperty(entity.position);
       //设置实体位置
       entity.position.setValue(position)
-      this.markSatelliteLine(oldPosition,position,'Blue')
+      this.markSatelliteLine(oldPosition,position,'Blue',viewer)
     }
   }
 };