Browse Source

fix: 不同道路load数据

jinx 2 years ago
parent
commit
865bb6d914

File diff suppressed because it is too large
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 4 - 4
src/graphic/Load.js

@@ -15,7 +15,7 @@ import { textService } from "./Service/TextService.js";
 import { svgService } from "./Service/SVGService.js";
 import { mathUtil } from "./Util/MathUtil.js";
 import { historyService } from "./Service/HistoryService.js";
-
+import { uiService } from "./Service/UIService";
 export default class Load {
   constructor(layer) {
     this.layer = layer;
@@ -206,6 +206,8 @@ export default class Load {
       }
       if(dataLocal.roads){
         for (let key in dataLocal.roads) {
+          uiService.setWayType(dataLocal.roads[key].way);
+          uiService.setSingleRoadDrivewayCount( dataLocal.roads[key].singleRoadDrivewayCount)
           let road = roadService.create(
             dataLocal.roads[key].startId,
             dataLocal.roads[key].endId,
@@ -234,12 +236,9 @@ export default class Load {
                     }
                   }
                 }
-            
               }
-            
             }
           }
-        
         }
       }
       if(dataLocal.curveRoadPoints){
@@ -383,6 +382,7 @@ export default class Load {
 
     const scale = res / (coordinate.zoom / coordinate.defaultZoom);
     dataService.setScale(scale);
+    console.log({...dataService.vectorData,Settings})
     return {...dataService.vectorData,Settings};
   }
 

+ 6 - 0
src/graphic/Service/StateService.js

@@ -65,6 +65,9 @@ export default class StateService {
       return;
     } else if (this.draggingItem.type == VectorType.Line) {
       const line = dataService.getLine(this.draggingItem.vectorId);
+      if(!line){
+        return 
+      }
       this.draggingItem.category = line.getCategory();
     } else if (this.draggingItem.type == VectorType.Point) {
       const point = dataService.getPoint(this.draggingItem.vectorId);
@@ -86,6 +89,9 @@ export default class StateService {
       return;
     } else if (this.focusItem.type == VectorType.Line) {
       const line = dataService.getLine(this.focusItem.vectorId);
+      if(!line){
+        return
+      }
       this.focusItem.category = line.getCategory();
     } else if (this.focusItem.type == VectorType.Point) {
       const point = dataService.getPoint(this.focusItem.vectorId);