|
@@ -11,12 +11,14 @@ import { moveSVG } from "./Controls/MoveSVG";
|
|
|
import { moveMagnifier } from "./Controls/MoveMagnifier";
|
|
|
import { addRoad } from "./Controls/AddRoad";
|
|
|
import { addLine } from "./Controls/AddLine";
|
|
|
+import { addPoint } from "./Controls/AddPoint";
|
|
|
import { addCircle } from "./Controls/AddCircle";
|
|
|
import { addText } from "./Controls/AddText";
|
|
|
import { addMagnifier } from "./Controls/AddMagnifier";
|
|
|
import { addSVG } from "./Controls/AddSVG";
|
|
|
import { moveRoad } from "./Controls/MoveRoad";
|
|
|
import { moveLine } from "./Controls/MoveLine";
|
|
|
+import { movePoint } from "./Controls/MovePoint";
|
|
|
import { moveCircle } from "./Controls/MoveCircle";
|
|
|
import { coordinate } from "./Coordinate";
|
|
|
import Render from "./Renderer/Render";
|
|
@@ -34,6 +36,7 @@ import { edgeService } from "./Service/EdgeService";
|
|
|
import { roadPointService } from "./Service/RoadPointService";
|
|
|
import { curveRoadService } from "./Service/CurveRoadService";
|
|
|
import VectorCategory from "./enum/VectorCategory";
|
|
|
+import Settings from "./Settings";
|
|
|
|
|
|
const minDragDis = 10;
|
|
|
const minZoom = 20;
|
|
@@ -114,8 +117,6 @@ export default class Layer {
|
|
|
// 右键
|
|
|
if (e.button == 2) {
|
|
|
this.stopAddVector();
|
|
|
- this.uiControl.currentUI = null;
|
|
|
- this.renderer.autoRedraw();
|
|
|
return;
|
|
|
}
|
|
|
this.dragging = false;
|
|
@@ -136,6 +137,15 @@ export default class Layer {
|
|
|
stateService.setEventName(LayerEvents.AddingLine);
|
|
|
addLine.setNewLinePoint(position);
|
|
|
break;
|
|
|
+ case LayerEvents.AddPoint:
|
|
|
+ stateService.setEventName(LayerEvents.MovePoint);
|
|
|
+ const newPoint = addPoint.buildPoint(position);
|
|
|
+ stateService.setSelectItem(
|
|
|
+ newPoint.vectorId,
|
|
|
+ VectorType.Point,
|
|
|
+ SelectState.Select
|
|
|
+ );
|
|
|
+ break;
|
|
|
case LayerEvents.AddCircle:
|
|
|
stateService.setEventName(LayerEvents.AddingCircle);
|
|
|
addCircle.setCenter(position);
|
|
@@ -361,6 +371,7 @@ export default class Layer {
|
|
|
elementService.setPoint(position);
|
|
|
if (addLine.newLine == null) {
|
|
|
addLine.buildLine(position);
|
|
|
+ this.updateBaseLine();
|
|
|
} else {
|
|
|
addLine.updateLine(position);
|
|
|
}
|
|
@@ -568,7 +579,7 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
- moveLine.movePoint(position, draggingItem.vectorId);
|
|
|
+ movePoint.movePoint(position, draggingItem.vectorId);
|
|
|
needAutoRedraw = true;
|
|
|
}
|
|
|
break;
|
|
@@ -1096,5 +1107,19 @@ export default class Layer {
|
|
|
addLine.clear(); //之前会保留category
|
|
|
this.uiControl.clearUI();
|
|
|
elementService.hideAll();
|
|
|
+ this.renderer.autoRedraw();
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新定位信息
|
|
|
+ updateForLocation() {
|
|
|
+ if (
|
|
|
+ addLine.newLine &&
|
|
|
+ addLine.newLine.getCategory() == VectorCategory.Line.BaseLine
|
|
|
+ ) {
|
|
|
+ Settings.baseLineId = addLine.newLine.vectorId;
|
|
|
+ this.uiControl.graphicStateUI.canAngleLocationMode = true;
|
|
|
+ this.uiControl.graphicStateUI.canAllLocationMode = true;
|
|
|
+ this.uiControl.graphicState.existsBaseLine = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|