|
@@ -66,14 +66,14 @@ export default class HistoryUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // road2赋值给road1
|
|
|
|
- assignRoadFromRoad(road1, road2) {
|
|
|
|
- const roadInfo = {};
|
|
|
|
- roadInfo.vectorId = road1.vectorId;
|
|
|
|
- roadInfo.start = road2.startId;
|
|
|
|
- roadInfo.end = road2.endId;
|
|
|
|
- this.setRoadInfo(roadInfo);
|
|
|
|
- }
|
|
|
|
|
|
+ // // road2赋值给road1
|
|
|
|
+ // assignRoadFromRoad(road1, road2) {
|
|
|
|
+ // const roadInfo = {};
|
|
|
|
+ // roadInfo.vectorId = road1.vectorId;
|
|
|
|
+ // roadInfo.start = road2.startId;
|
|
|
|
+ // roadInfo.end = road2.endId;
|
|
|
|
+ // this.setRoadInfo(roadInfo);
|
|
|
|
+ // }
|
|
|
|
|
|
assignPointFromPoint(point1, point2) {
|
|
assignPointFromPoint(point1, point2) {
|
|
const pointInfo = {};
|
|
const pointInfo = {};
|
|
@@ -83,6 +83,30 @@ export default class HistoryUtil {
|
|
this.setPointInfo(pointInfo);
|
|
this.setPointInfo(pointInfo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ assignLineFromLine(line1, line2) {
|
|
|
|
+ const lineInfo = {};
|
|
|
|
+ lineInfo.vectorId = line1.vectorId;
|
|
|
|
+ lineInfo.start = line2.startId;
|
|
|
|
+ lineInfo.end = line2.endId;
|
|
|
|
+ this.setLineInfo(lineInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ assignSimpleLineFromSimpleLine(simpleLine1, simpleLine2) {
|
|
|
|
+ const simpleLineInfo = {};
|
|
|
|
+ simpleLineInfo.vectorId = simpleLine1.vectorId;
|
|
|
|
+ simpleLineInfo.start = simpleLine2.start;
|
|
|
|
+ simpleLineInfo.end = simpleLine2.end;
|
|
|
|
+ this.setSimpleLineInfo(simpleLineInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ assignLineFromLine(line1, line2) {
|
|
|
|
+ const lineInfo = {};
|
|
|
|
+ lineInfo.vectorId = line1.vectorId;
|
|
|
|
+ lineInfo.start = line2.startId;
|
|
|
|
+ lineInfo.end = line2.endId;
|
|
|
|
+ this.setLineInfo(lineInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
assignTextFromText(text1, text2) {
|
|
assignTextFromText(text1, text2) {
|
|
const textInfo = {};
|
|
const textInfo = {};
|
|
textInfo.vectorId = text1.vectorId;
|
|
textInfo.vectorId = text1.vectorId;
|
|
@@ -93,14 +117,6 @@ export default class HistoryUtil {
|
|
this.setTextInfo(textInfo);
|
|
this.setTextInfo(textInfo);
|
|
}
|
|
}
|
|
|
|
|
|
- deletePoint(pointId) {
|
|
|
|
- const point = dataService.getRoadPoint(pointId);
|
|
|
|
- const parent = point.parent;
|
|
|
|
- for (const key in parent) {
|
|
|
|
- dataService.deleteRoadPoint(pointId, key);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
getDataForPoint(point) {
|
|
getDataForPoint(point) {
|
|
const data = {};
|
|
const data = {};
|
|
data.id = point.vectorId;
|
|
data.id = point.vectorId;
|
|
@@ -110,12 +126,33 @@ export default class HistoryUtil {
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
- getDataForRoad(road) {
|
|
|
|
|
|
+ getDataForLine(line) {
|
|
|
|
+ const data = {};
|
|
|
|
+ data.id = line.vectorId;
|
|
|
|
+ data.start = line.startId;
|
|
|
|
+ data.end = line.endId;
|
|
|
|
+ data.type = line.geoType;
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getDataForSimpleLine(simpleLine) {
|
|
const data = {};
|
|
const data = {};
|
|
- data.id = road.vectorId;
|
|
|
|
- data.start = road.startId;
|
|
|
|
- data.end = road.endId;
|
|
|
|
- data.type = road.geoType;
|
|
|
|
|
|
+ data.id = simpleLine.vectorId;
|
|
|
|
+ data.start = {};
|
|
|
|
+ mathUtil.clonePoint(data.start, simpleLine.start);
|
|
|
|
+ data.end = {};
|
|
|
|
+ mathUtil.clonePoint(data.end, simpleLine.end);
|
|
|
|
+ data.type = simpleLine.geoType;
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getDataForCircle(circle) {
|
|
|
|
+ const data = {};
|
|
|
|
+ data.id = circle.vectorId;
|
|
|
|
+ data.center = {};
|
|
|
|
+ mathUtil.clonePoint(data.center, circle.center);
|
|
|
|
+ data.radius = circle.radius;
|
|
|
|
+ data.type = circle.geoType;
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -130,24 +167,41 @@ export default class HistoryUtil {
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
- getDataForRes(res) {
|
|
|
|
- return res;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- setRoadInfo(roadInfo) {
|
|
|
|
- let road = dataService.getRoad(roadInfo.vectorId);
|
|
|
|
- road.start = roadInfo.start;
|
|
|
|
- road.end = roadInfo.end;
|
|
|
|
- return road;
|
|
|
|
- }
|
|
|
|
|
|
+ // setRoadInfo(roadInfo) {
|
|
|
|
+ // let road = dataService.getRoad(roadInfo.vectorId);
|
|
|
|
+ // road.start = roadInfo.start;
|
|
|
|
+ // road.end = roadInfo.end;
|
|
|
|
+ // return road;
|
|
|
|
+ // }
|
|
|
|
|
|
setPointInfo(pointInfo) {
|
|
setPointInfo(pointInfo) {
|
|
- let point = dataService.getRoadPoint(pointInfo.vectorId);
|
|
|
|
|
|
+ let point = dataService.getPoint(pointInfo.vectorId);
|
|
mathUtil.clonePoint(point, pointInfo.position);
|
|
mathUtil.clonePoint(point, pointInfo.position);
|
|
point.parent = JSON.parse(JSON.stringify(pointInfo.parent));
|
|
point.parent = JSON.parse(JSON.stringify(pointInfo.parent));
|
|
return point;
|
|
return point;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ setLineInfo(lineInfo) {
|
|
|
|
+ let line = dataService.getLine(lineInfo.vectorId);
|
|
|
|
+ line.startId = lineInfo.start;
|
|
|
|
+ line.endId = lineInfo.end;
|
|
|
|
+ return line;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ setSimpleLineInfo(simpleLineInfo) {
|
|
|
|
+ let simpleLine = dataService.getSimpleLine(simpleLineInfo.vectorId);
|
|
|
|
+ simpleLine.start = simpleLineInfo.start;
|
|
|
|
+ simpleLine.end = simpleLineInfo.end;
|
|
|
|
+ return simpleLine;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ setCircleInfo(circleInfo) {
|
|
|
|
+ let circle = dataService.getCircle(circleInfo.vectorId);
|
|
|
|
+ circle.center = circleInfo.center;
|
|
|
|
+ circle.radius = circleInfo.radius;
|
|
|
|
+ return circle;
|
|
|
|
+ }
|
|
|
|
+
|
|
setTextInfo(textInfo) {
|
|
setTextInfo(textInfo) {
|
|
let text = dataService.getText(textInfo.vectorId);
|
|
let text = dataService.getText(textInfo.vectorId);
|
|
text.vectorId = textInfo.vectorId;
|
|
text.vectorId = textInfo.vectorId;
|