zhiyuan-007 пре 1 месец
родитељ
комит
268b5314e0

+ 14 - 14
src/components/mapJK.vue

@@ -2495,29 +2495,29 @@ export default {
         let status = params.status;
         const connectFlyPointWebSocket = (status) => {
           if(status === "show"){
+            debugger
             if(flyPointSocket){
-              flyPointSocket.send(JSON.stringify(params.flyList));
+              return
             }else{
-              flyPointSocket = new WebSocket('ws://58.34.215.19:8100/flight/data/webSocket');
+              flyPointSocket = new WebSocket('ws://58.34.215.19:8100/flight/data/websocket');
               flyPointSocket.onopen = () => {
                 console.log('WebSocket 连接成功');
-                flyPointSocket.send(JSON.stringify(params.flyList));
               };
               flyPointSocket.onmessage = (messageEvent) => {
-                let messages = JSON.parse(messageEvent.data).data;
-                debugger
-                // if(moveCarEvent){
-                //   moveCarEvent.update(messages)
-                // }else{
-                //   moveCarEvent = new MoveCarEvent({
-                //     view:m_view,
-                //     map:m_map,
-                //     paths:params.paths
-                //   });
-                // }
+                let messages = JSON.parse(messageEvent.data);
+                if(moveCarEvent){
+                  moveCarEvent.update(messages)
+                }else{
+                  moveCarEvent = new MoveCarEvent({
+                    view:m_view,
+                    map:m_map,
+                    data:messages
+                  });
+                }
               };
 
               flyPointSocket.onerror = (error) => {
+                debugger
                 console.error('WebSocket 出错:', error);
               };
 

+ 5 - 2
src/config/basicTool.json

@@ -42,7 +42,7 @@
             "title":"BaseMap",
             "visible": true,
             "opacity": 1,
-            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDAzNjM4NDksImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.Ts_25l_fc7zp0t6W30I7ot0bj9ziQGiWhQv12MlB700",
+            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDA0NTIxNTYsImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.uI40kUANA3VqXUYhxXvEgY0TzdqOAeZkulfdtZygeik",
             "token": ""
           }
         }
@@ -58,7 +58,7 @@
             "title":"WhiteMold",
             "visible": true,
             "opacity": 1,
-            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDAyMDMyMjgsImtleSI6IjA1MTk1NDE4Iiwic2VydmljZU5vIjoiRDkwMDMwMDA2MjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.1RDpnvYpWIMQayx5tHKelIYsH6V_JDxtuRHqVwQx1Ic",
+            "url": "\nhttps://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDA0NTM4OTIsImtleSI6IjA1MTk1NDE4Iiwic2VydmljZU5vIjoiRDkwMDMwMDA2MjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.10E5RmknF8evyx7lsSgoLOPcxTUMMiNeoq6WbDRs3ok",
             "token": ""
           }
         }
@@ -2084,6 +2084,9 @@
           "ActionName": "MoveCar",
           "Parameters": {
             "status": "show",
+            "flyList": {"date": "2025-02-20 16:29:22",
+              "step": 2,
+              "second":3},
             "token": ""
           }
         }

+ 1 - 3
src/service/http.js

@@ -50,9 +50,7 @@ export function getPowerPoint(params){
                 "pageSize": 100000,
                 "scrollId": params.scrollId
             },
-            "elementCount":{
-              "10.0":1
-            },
+            "version": "v3",
             "isShowInfo":0,
             "level":params.level
         }

+ 30 - 19
src/units/map/MoveCarEvent.js

@@ -1,45 +1,56 @@
 import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer.js";
 import Graphic from "@arcgis/core/Graphic.js";
 import Point from "@arcgis/core/geometry/Point.js";
+import dangerIcon from "../../assets/预警.png";
+import levelFrIcon from "../../assets/三维_点.png";
 class MoveCarEvent {
     constructor(options) {
         this.view = options.view;
-        this.paths = options.paths;
+        this.data = options.data;
         this.graphicsLayer = null;
         this.ready();
     }
      ready(){
         this.graphicsLayer = new GraphicsLayer({
             id:"moveCar",
-            title:"汽车移动",
+            title:"汽车移动"
         });
         this.view.map.add(this.graphicsLayer);
-        this.setGraphics(this.paths);
+        this.setGraphics(this.data);
      }
-     update(paths){
+     update(data){
         //更新点位geometry以及attribute信息
          this.graphicsLayer.removeAll();
-         this.setGraphics(paths);
+         this.setGraphics(data);
+         this.updateTrajectories(data);
      }
-     setGraphics(paths){
-         for(let key in paths){
+     setGraphics(data){
+         for(let key in data){
              this.graphicsLayer.add(new Graphic({
                  geometry:new Point({
-                     x:paths[key].point.x,
-                     y:paths[key].point.y,
-                     z:paths[key].point.z,
+                     x:data[key].x,
+                     y:data[key].y,
+                     z:data[key].z,
                      spatialReference:this.view.spatialReference,
                  }),
-                 symbolLayers:[{
-                     type:"point-3d",
-                     resource:{
-                         href:"gltf/wrj.glb"
-                     },
-                     depth:6
-                 }],
+                 symbol: {
+                     type: "point-3d",
+                     symbolLayers:[{
+                         type: "icon",
+                         resource: {
+                             href: levelFrIcon
+                         },
+                         size: 50,
+                         outline: {
+                             color: "white",
+                             size: 2
+                         }
+                     }]
+                 },
                  attributes:{
-                     id:paths[key].id,
-                     name:paths[key].name
+                     id:data[key].id,
+                     name:data[key].name,
+                     type:data[key].overall,
                  },
              }));
          }

+ 2 - 2
src/units/map/MoveCarFeatureEvent.js

@@ -44,7 +44,7 @@ class MoveCarFeatureEvent{
                     {
                         value: "1", // 唯一值对应 id
                         symbol: {
-                            type: "polygon-3d",
+                            type: "point-3d",
                             symbolLayers: [
                                 {
                                     type: "icon",
@@ -63,7 +63,7 @@ class MoveCarFeatureEvent{
                     {
                         value: "2", // 唯一值对应 id
                         symbol: {
-                            type: "polygon-3d",
+                            type: "point-3d",
                             symbolLayers: [
                                 {
                                     type: "icon",