|
@@ -6,6 +6,8 @@ import { curveRoadService } from "../Service/CurveRoadService";
|
|
|
import { coordinate } from "../Coordinate";
|
|
|
import { edgeService } from "../Service/EdgeService";
|
|
|
import { crossPointService } from "../Service/CrossPointService";
|
|
|
+import { roadPointService } from "../Service/RoadPointService";
|
|
|
+import { listenLayer } from "../ListenLayer";
|
|
|
|
|
|
export default class MoveRoad {
|
|
|
constructor() {
|
|
@@ -134,6 +136,49 @@ export default class MoveRoad {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ finishByMoveRoadPoint(point) {
|
|
|
+ if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("linkedRoadPointId")
|
|
|
+ ) {
|
|
|
+ this.moveTo(point.vectorId, listenLayer.modifyPoint.linkedRoadPointId);
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ (listenLayer.modifyPoint.linkedRoadPointIdX ||
|
|
|
+ listenLayer.modifyPoint.linkedRoadPointIdY)
|
|
|
+ ) {
|
|
|
+ mathUtil.clonePoint(point, listenLayer.modifyPoint);
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("linkedRoadId")
|
|
|
+ ) {
|
|
|
+ // let splitRoadPoint = roadPointService.create({
|
|
|
+ // x: listenLayer.modifyPoint.x,
|
|
|
+ // y: listenLayer.modifyPoint.y,
|
|
|
+ // });
|
|
|
+ // roadService.splitRoad(
|
|
|
+ // listenLayer.modifyPoint.linkedRoadId,
|
|
|
+ // splitRoadPoint.vectorId,
|
|
|
+ // "start"
|
|
|
+ // );
|
|
|
+ roadService.splitRoad(
|
|
|
+ listenLayer.modifyPoint.linkedRoadId,
|
|
|
+ point.vectorId,
|
|
|
+ "start"
|
|
|
+ );
|
|
|
+ //this.moveTo(point.vectorId, point.vectorId);
|
|
|
+ edgeService.updateEdgeForMovePoint(point.vectorId);
|
|
|
+ } else if (this.splitRoadId != null) {
|
|
|
+ roadService.splitRoad(this.splitRoadId, point.vectorId, "start");
|
|
|
+ }
|
|
|
+ //draggingItem.vectorId所在的墙面与其他墙角相交
|
|
|
+ this.updateForAbsorbRoadPoints();
|
|
|
+ let parent = point.getParent();
|
|
|
+ for (let key in parent) {
|
|
|
+ roadService.setLanes(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//拖拽墙角/墙面,被其他墙角吸附
|
|
|
updateForAbsorbRoadPoints() {
|
|
|
if (Object.keys(this.adsorbPointRoads).length == 0) {
|