|
@@ -26,6 +26,7 @@ import { roadService } from "./Service/RoadService";
|
|
import { edgeService } from "./Service/EdgeService";
|
|
import { edgeService } from "./Service/EdgeService";
|
|
import { roadPointService } from "./Service/RoadPointService";
|
|
import { roadPointService } from "./Service/RoadPointService";
|
|
import { curveRoadService } from "./Service/CurveRoadService";
|
|
import { curveRoadService } from "./Service/CurveRoadService";
|
|
|
|
+import VectorCategory from "./enum/VectorCategory";
|
|
|
|
|
|
const minDragDis = 10;
|
|
const minDragDis = 10;
|
|
|
|
|
|
@@ -215,12 +216,29 @@ export default class Layer {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- elementService.execute(addLine.startInfo.position, position);
|
|
|
|
|
|
+ elementService.hideAll();
|
|
elementService.setPoint(position);
|
|
elementService.setPoint(position);
|
|
- elementService.setNewRoad(addLine.startInfo.position, position);
|
|
|
|
- elementService.showNewRoad();
|
|
|
|
|
|
+ elementService.showPoint();
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ elementService.execute(listenLayer.modifyPoint, position);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case LayerEvents.AddCircle:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ listenLayer.start(position);
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ position = {
|
|
|
|
+ x: listenLayer.modifyPoint.x,
|
|
|
|
+ y: listenLayer.modifyPoint.y,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
|
|
- addLine.setNewLinePoint("end", position);
|
|
|
|
|
|
+ elementService.hideAll();
|
|
|
|
+ elementService.setPoint(position);
|
|
|
|
+ elementService.showPoint();
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ elementService.execute(listenLayer.modifyPoint, position);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case LayerEvents.AddingRoad:
|
|
case LayerEvents.AddingRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
@@ -257,9 +275,23 @@ export default class Layer {
|
|
elementService.execute(addLine.startInfo.position, position);
|
|
elementService.execute(addLine.startInfo.position, position);
|
|
elementService.setPoint(position);
|
|
elementService.setPoint(position);
|
|
elementService.setNewLine(addLine.startInfo.position, position);
|
|
elementService.setNewLine(addLine.startInfo.position, position);
|
|
|
|
+ elementService.setNewLineCategory(VectorCategory.Line.NormalLine);
|
|
elementService.showNewLine();
|
|
elementService.showNewLine();
|
|
addLine.setNewLinePoint("end", position);
|
|
addLine.setNewLinePoint("end", position);
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddingCircle:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ listenLayer.start(position);
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ position = {
|
|
|
|
+ x: listenLayer.modifyPoint.x,
|
|
|
|
+ y: listenLayer.modifyPoint.y,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ elementService.execute(addCircle.center, position);
|
|
|
|
+ elementService.setPoint(position);
|
|
|
|
+ addCircle.setRadius(mathUtil.getDistance(addCircle.center, position));
|
|
|
|
+ break;
|
|
case LayerEvents.MoveRoad:
|
|
case LayerEvents.MoveRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
//只允许拖拽一条公路
|
|
//只允许拖拽一条公路
|
|
@@ -566,6 +598,13 @@ export default class Layer {
|
|
this.history.save();
|
|
this.history.save();
|
|
elementService.hideAll();
|
|
elementService.hideAll();
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddingCircle:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ addCircle.buildCircle();
|
|
|
|
+ addCircle.clear();
|
|
|
|
+ this.history.save();
|
|
|
|
+ elementService.hideAll();
|
|
|
|
+ break;
|
|
// case LayerEvents.AddCurveRoad:
|
|
// case LayerEvents.AddCurveRoad:
|
|
// addRoad.setNewRoadPoint("start", position);
|
|
// addRoad.setNewRoadPoint("start", position);
|
|
// break;
|
|
// break;
|
|
@@ -838,6 +877,8 @@ export default class Layer {
|
|
stateService.setEventName(LayerEvents.MoveLine);
|
|
stateService.setEventName(LayerEvents.MoveLine);
|
|
} else if (selectItem.type == VectorType.CurveLine) {
|
|
} else if (selectItem.type == VectorType.CurveLine) {
|
|
stateService.setEventName(LayerEvents.MoveCurveLine);
|
|
stateService.setEventName(LayerEvents.MoveCurveLine);
|
|
|
|
+ } else if (selectItem.type == VectorType.Circle) {
|
|
|
|
+ stateService.setEventName(LayerEvents.MoveCircle);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (eventType == "mouseUp") {
|
|
} else if (eventType == "mouseUp") {
|