Selaa lähdekoodia

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

bill 2 vuotta sitten
vanhempi
commit
6771bcba98
2 muutettua tiedostoa jossa 15 lisäystä ja 10 poistoa
  1. 10 7
      src/graphic/Layer.js
  2. 5 3
      src/graphic/Load.js

+ 10 - 7
src/graphic/Layer.js

@@ -357,14 +357,16 @@ export default class Layer {
       case VectorEvents.MinusCrossPoint:
         if (selectItem && selectItem.vectorId) {
           const curvePoint = dataService.getCurveRoadPoint(selectItem.vectorId);
-          const curveRoad = dataService.getCurveRoad(curvePoint.parent);
-          if (curveRoad.points.length > 3) {
-            curveRoadService.subCPoint(curveRoad, curvePoint.getIndex());
-            curveRoadService.setLanes(curveRoad.vectorId);
-            stateService.clearEventName();
+          if (curvePoint) {
+            const curveRoad = dataService.getCurveRoad(curvePoint.parent);
+            if (curveRoad.points.length > 3) {
+              curveRoadService.subCPoint(curveRoad, curvePoint.getIndex());
+              curveRoadService.setLanes(curveRoad.vectorId);
+              stateService.clearEventName();
+            }
+            this.history.save();
+            this.renderer.autoRedraw();
           }
-          this.history.save();
-          this.renderer.autoRedraw();
         }
         break;
     }
@@ -1001,6 +1003,7 @@ export default class Layer {
         if (e instanceof TouchEvent) {
           stateService.clearSelectItem();
           stateService.clearDraggingItem();
+          this.uiControl.focusVector = null;
           this.renderer.autoRedraw();
         }
         return;

+ 5 - 3
src/graphic/Load.js

@@ -184,10 +184,12 @@ export default class Load {
 
       if (dataLocal.roadPoints) {
         for (let key in dataLocal.roadPoints) {
-          roadPointService.create(
+          let roadPointData = dataLocal.roadPoints[key];
+          let roadPoint = roadPointService.create(
             dataLocal.roadPoints[key],
             dataLocal.roadPoints[key].vectorId
           );
+          roadPoint.parent = JSON.parse(JSON.stringify(roadPointData.parent));
         }
       }
 
@@ -244,7 +246,7 @@ export default class Load {
 
       if (dataLocal.curveRoadPoints) {
         for (let key in dataLocal.curveRoadPoints) {
-          let curveRoadPoint = curveRoadPointService.create(
+          curveRoadPointService.create(
             dataLocal.curveRoadPoints[key],
             dataLocal.curveRoadPoints[key].vectorId
           );
@@ -282,7 +284,7 @@ export default class Load {
 
           curveRoad.points = [];
           for (let i = 0; i < curveRoadData.points.length; ++i) {
-            curveRoad.points[i] = dataService.getCurvePoint(
+            curveRoad.points[i] = dataService.getCurveRoadPoint(
               curveRoadData.points[i].vectorId
             );
           }