|
@@ -13,6 +13,7 @@ import { addRoad } from "./Controls/AddRoad";
|
|
import { addLine } from "./Controls/AddLine";
|
|
import { addLine } from "./Controls/AddLine";
|
|
import { addPoint } from "./Controls/AddPoint";
|
|
import { addPoint } from "./Controls/AddPoint";
|
|
import { addCircle } from "./Controls/AddCircle";
|
|
import { addCircle } from "./Controls/AddCircle";
|
|
|
|
+import { addElliptic } from "./Controls/AddElliptic";
|
|
import { addText } from "./Controls/AddText";
|
|
import { addText } from "./Controls/AddText";
|
|
import { addMagnifier } from "./Controls/AddMagnifier";
|
|
import { addMagnifier } from "./Controls/AddMagnifier";
|
|
import { addSVG } from "./Controls/AddSVG";
|
|
import { addSVG } from "./Controls/AddSVG";
|
|
@@ -20,6 +21,7 @@ import { moveRoad } from "./Controls/MoveRoad";
|
|
import { moveLine } from "./Controls/MoveLine";
|
|
import { moveLine } from "./Controls/MoveLine";
|
|
import { movePoint } from "./Controls/MovePoint";
|
|
import { movePoint } from "./Controls/MovePoint";
|
|
import { moveCircle } from "./Controls/MoveCircle";
|
|
import { moveCircle } from "./Controls/MoveCircle";
|
|
|
|
+import { moveElliptic } from "./Controls/MoveElliptic";
|
|
import { coordinate } from "./Coordinate";
|
|
import { coordinate } from "./Coordinate";
|
|
import Render from "./Renderer/Render";
|
|
import Render from "./Renderer/Render";
|
|
import { draw } from "./Renderer/Draw";
|
|
import { draw } from "./Renderer/Draw";
|
|
@@ -161,6 +163,10 @@ export default class Layer {
|
|
stateService.setEventName(LayerEvents.AddingCircle);
|
|
stateService.setEventName(LayerEvents.AddingCircle);
|
|
addCircle.setCenter(position);
|
|
addCircle.setCenter(position);
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddElliptic:
|
|
|
|
+ stateService.setEventName(LayerEvents.AddingElliptic);
|
|
|
|
+ addElliptic.setCenter(position);
|
|
|
|
+ break;
|
|
case LayerEvents.AddText:
|
|
case LayerEvents.AddText:
|
|
stateService.setEventName(LayerEvents.MoveText);
|
|
stateService.setEventName(LayerEvents.MoveText);
|
|
addText.buildText(position);
|
|
addText.buildText(position);
|
|
@@ -360,6 +366,20 @@ export default class Layer {
|
|
elementService.showPoint();
|
|
elementService.showPoint();
|
|
this.showElementLine(position);
|
|
this.showElementLine(position);
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddElliptic:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ listenLayer.start(position);
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ position = {
|
|
|
|
+ x: listenLayer.modifyPoint.x,
|
|
|
|
+ y: listenLayer.modifyPoint.y,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ elementService.hideAll();
|
|
|
|
+ elementService.setPoint(position);
|
|
|
|
+ elementService.showPoint();
|
|
|
|
+ this.showElementLine(position);
|
|
|
|
+ break;
|
|
case LayerEvents.AddingRoad:
|
|
case LayerEvents.AddingRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
@@ -458,8 +478,6 @@ export default class Layer {
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
};
|
|
};
|
|
}
|
|
}
|
|
- // elementService.execute(addCircle.center, position);
|
|
|
|
- // elementService.setPoint(position);
|
|
|
|
if (addCircle.newCircle == null) {
|
|
if (addCircle.newCircle == null) {
|
|
addCircle.buildCircle(position);
|
|
addCircle.buildCircle(position);
|
|
} else {
|
|
} else {
|
|
@@ -470,6 +488,29 @@ export default class Layer {
|
|
elementService.showPoint();
|
|
elementService.showPoint();
|
|
this.showElementLine(position);
|
|
this.showElementLine(position);
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddingElliptic:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ let exceptEllipticId = null;
|
|
|
|
+ if (addElliptic.newElliptic != null) {
|
|
|
|
+ exceptEllipticId = addElliptic.newElliptic.vectorId;
|
|
|
|
+ }
|
|
|
|
+ listenLayer.start(position, { exceptEllipticId: exceptEllipticId });
|
|
|
|
+ if (listenLayer.modifyPoint) {
|
|
|
|
+ position = {
|
|
|
|
+ x: listenLayer.modifyPoint.x,
|
|
|
|
+ y: listenLayer.modifyPoint.y,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ if (addElliptic.newElliptic == null) {
|
|
|
|
+ addElliptic.buildElliptic(position);
|
|
|
|
+ } else {
|
|
|
|
+ addElliptic.updateElliptic(position);
|
|
|
|
+ }
|
|
|
|
+ elementService.hideAll();
|
|
|
|
+ elementService.setPoint(position);
|
|
|
|
+ elementService.showPoint();
|
|
|
|
+ this.showElementLine(position);
|
|
|
|
+ break;
|
|
case LayerEvents.MoveRoad:
|
|
case LayerEvents.MoveRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
//只允许拖拽一条公路
|
|
//只允许拖拽一条公路
|
|
@@ -681,6 +722,31 @@ export default class Layer {
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.MoveElliptic:
|
|
|
|
+ if (draggingItem != null) {
|
|
|
|
+ if (draggingItem.state == -1) {
|
|
|
|
+ moveElliptic.moveFull(
|
|
|
|
+ draggingItem.vectorId,
|
|
|
|
+ (dx * coordinate.defaultZoom) / coordinate.zoom,
|
|
|
|
+ (dy * coordinate.defaultZoom) / coordinate.zoom
|
|
|
|
+ );
|
|
|
|
+ } else if (
|
|
|
|
+ draggingItem.state == 0 ||
|
|
|
|
+ draggingItem.state == 1 ||
|
|
|
|
+ draggingItem.state == 2 ||
|
|
|
|
+ draggingItem.state == 3
|
|
|
|
+ ) {
|
|
|
|
+ moveElliptic.movePoint(
|
|
|
|
+ position,
|
|
|
|
+ draggingItem.vectorId,
|
|
|
|
+ draggingItem.state
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ debugger;
|
|
|
|
+ }
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
case LayerEvents.MoveText:
|
|
case LayerEvents.MoveText:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
if (draggingItem != null) {
|
|
if (draggingItem != null) {
|
|
@@ -857,6 +923,13 @@ export default class Layer {
|
|
this.history.save();
|
|
this.history.save();
|
|
elementService.hideAll();
|
|
elementService.hideAll();
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.AddingElliptic:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ addElliptic.finish(position);
|
|
|
|
+ addElliptic.clear();
|
|
|
|
+ this.history.save();
|
|
|
|
+ elementService.hideAll();
|
|
|
|
+ break;
|
|
case LayerEvents.MoveText:
|
|
case LayerEvents.MoveText:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
this.history.save();
|
|
this.history.save();
|
|
@@ -933,6 +1006,10 @@ export default class Layer {
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
this.history.save();
|
|
this.history.save();
|
|
break;
|
|
break;
|
|
|
|
+ case LayerEvents.MoveElliptic:
|
|
|
|
+ needAutoRedraw = true;
|
|
|
|
+ this.history.save();
|
|
|
|
+ break;
|
|
case LayerEvents.AddPoint:
|
|
case LayerEvents.AddPoint:
|
|
if (
|
|
if (
|
|
Settings.selectBasePointId != null &&
|
|
Settings.selectBasePointId != null &&
|
|
@@ -1199,6 +1276,8 @@ export default class Layer {
|
|
stateService.setEventName(LayerEvents.MoveCurveLine);
|
|
stateService.setEventName(LayerEvents.MoveCurveLine);
|
|
} else if (selectItem.type == VectorType.Circle) {
|
|
} else if (selectItem.type == VectorType.Circle) {
|
|
stateService.setEventName(LayerEvents.MoveCircle);
|
|
stateService.setEventName(LayerEvents.MoveCircle);
|
|
|
|
+ } else if (selectItem.type == VectorType.Elliptic) {
|
|
|
|
+ stateService.setEventName(LayerEvents.MoveElliptic);
|
|
} else if (selectItem.type == VectorType.Text) {
|
|
} else if (selectItem.type == VectorType.Text) {
|
|
stateService.setEventName(LayerEvents.MoveText);
|
|
stateService.setEventName(LayerEvents.MoveText);
|
|
} else if (selectItem.type == VectorType.Magnifier) {
|
|
} else if (selectItem.type == VectorType.Magnifier) {
|