jinx 2 gadi atpakaļ
vecāks
revīzija
26d6426d15
2 mainītis faili ar 58 papildinājumiem un 10 dzēšanām
  1. 9 1
      src/graphic/History/HistoryUtil.js
  2. 49 9
      src/graphic/Load.js

+ 9 - 1
src/graphic/History/HistoryUtil.js

@@ -28,7 +28,9 @@ export default class HistoryUtil {
       line1.startId == line2.startId &&
       line1.endId == line2.endId &&
       line1.category == line2.category &&
-      line1.locationMode == line2.locationMode
+      line1.locationMode == line2.locationMode && 
+      line1.style == line2.style && 
+      line1.weight == line2.weight 
     ) {
       return false;
     } else {
@@ -350,6 +352,8 @@ export default class HistoryUtil {
     lineInfo.category = line2.category;
     lineInfo.locationMode = line2.locationMode;
     lineInfo.value = line2.value;
+    lineInfo.style = line2.style;
+    lineInfo.weight = line2.weight;
     this.setLineInfo(lineInfo);
   }
 
@@ -592,6 +596,8 @@ export default class HistoryUtil {
     data.category = line.category;
     data.locationMode = line.locationMode;
     data.type = line.geoType;
+    data.style = line.style;
+    data.weight = line.weight;
     return data;
   }
 
@@ -821,6 +827,8 @@ export default class HistoryUtil {
     line.category = lineInfo.category;
     line.locationMode = lineInfo.locationMode;
     line.value = lineInfo.value;
+    line.style = lineInfo.style;
+    line.weight = lineInfo.weight;
     return line;
   }
 

+ 49 - 9
src/graphic/Load.js

@@ -149,6 +149,52 @@ export default class Load {
           }
         }
       }
+      // if (dataLocal.curvelines) {
+      //   for (let key in dataLocal.curvelines) {
+      //     let startPointId = dataLocal.curvelines[key].startId
+      //     let endPointId = dataLocal.curvelines[key].endId
+
+      //     let startPosition = null;
+      //     let endPosition = null ;
+      //     if(dataLocal.curvePoints){
+      //       startPosition ={ 
+      //         x:dataLocal.curvePoints[startPointId].x,
+      //         y:dataLocal.curvePoints[startPointId].y,
+      //       }
+      //       endPosition ={ 
+      //         x:dataLocal.curvePoints[endPointId].x,
+      //         y:dataLocal.curvePoints[endPointId].y,
+      //       }
+
+      //     }
+         
+      //     let curveline = lineService.createCurveLine(
+      //       startPosition,
+      //       endPosition,
+      //       dataLocal.curvelines[key].vectorId,
+      //     );
+
+      //     if (dataLocal.curvelines[key].style) {
+      //       curveline.setStyle(dataLocal.curvelines[key].style);
+      //     }
+      //     if (dataLocal.curvelines[key].weight) {
+      //       curveline.setWeight(dataLocal.curvelines[key].weight);
+      //     }
+      //     if (dataLocal.curvelines[key].color) {
+      //       curveline.setColor(dataLocal.curvelines[key].color);
+      //     }
+      //     if (dataLocal.curvelines[key].value) {
+      //       curveline.setValue(dataLocal.curvelines[key].value);
+      //     }
+      //     if (dataLocal.curvelines[key].locationMode) {
+      //       curveline.setLocationMode(dataLocal.curvelines[key].locationMode);
+      //     }
+      //     curveline.setDisplay(dataLocal.curvelines[key].display);
+      //     if (curveline.getCategory() == VectorCategory.Line.BaseLine) {
+      //       Settings.baseLineId = key;
+      //     }
+      //   }
+      // }
       if(dataLocal.roadPoints){
 
         for (let key in dataLocal.roadPoints) {
@@ -165,16 +211,12 @@ export default class Load {
             dataLocal.roads[key].endId,
             dataLocal.roads[key].vectorId,
           );
-          let leftEdge =null
-          let rightEdge =null
-          if(dataLocal.roadEdges){
+          if(dataLocal.roadEdges){ //当roadEdge有样式的时候需要设置
             for(let edgeKey in dataLocal.roadEdges){
               let roadId = dataLocal.roadEdges[edgeKey].parent
-            
               if(roadId== key ){
-
                 for(let roadKey in dataLocal.roads[key]){
-                  if( roadKey == 'leftEdgeId' && dataLocal.roads[key][roadKey] ==dataLocal.roadEdges[edgeKey].vectorId){
+                  if( roadKey == 'leftEdgeId' && dataLocal.roads[key][roadKey] == dataLocal.roadEdges[edgeKey].vectorId){
                     let leftEdge = dataService.getRoadEdge(road.leftEdgeId);
                     if(dataLocal.roadEdges[edgeKey].style){
                       leftEdge.setStyle(dataLocal.roadEdges[edgeKey].style)
@@ -182,9 +224,7 @@ export default class Load {
                     if(dataLocal.roadEdges[edgeKey].weight){
                       leftEdge.setWeight(dataLocal.roadEdges[edgeKey].weight)
                     }
-
-
-                  }else if(roadKey == 'rightEdgeId' && dataLocal.roads[key][roadKey] ==dataLocal.roadEdges[edgeKey].vectorId){
+                  }else if(roadKey == 'rightEdgeId' && dataLocal.roads[key][roadKey] == dataLocal.roadEdges[edgeKey].vectorId){
                     let rightEdge = dataService.getRoadEdge(road.rightEdgeId);
                     if(dataLocal.roadEdges[edgeKey].style){
                       rightEdge.setStyle(dataLocal.roadEdges[edgeKey].style)