|
@@ -129,6 +129,7 @@ export default class Layer {
|
|
|
//用于支持平板电脑
|
|
|
listenLayer.start(position);
|
|
|
let selectItem = stateService.getSelectItem();
|
|
|
+ let focusItem = stateService.getFocusItem();
|
|
|
this.setEventName("mouseDown");
|
|
|
const eventName = stateService.getEventName();
|
|
|
switch (eventName) {
|
|
@@ -272,8 +273,8 @@ export default class Layer {
|
|
|
}
|
|
|
break;
|
|
|
case VectorEvents.AddCrossPoint:
|
|
|
- if (selectItem && selectItem.dir && selectItem.vectorId) {
|
|
|
- const curveRoad = dataService.getCurveRoad(selectItem.vectorId);
|
|
|
+ if (focusItem && focusItem.vectorId) {
|
|
|
+ const curveRoad = dataService.getCurveRoad(focusItem.vectorId);
|
|
|
let index = mathUtil.getIndexForCurvesPoints(
|
|
|
position,
|
|
|
curveRoad.points
|
|
@@ -296,17 +297,21 @@ export default class Layer {
|
|
|
curveRoadService.addCPoint(curveRoad, position, 1);
|
|
|
}
|
|
|
}
|
|
|
+ curveRoadService.setLanes(curveRoad.vectorId);
|
|
|
stateService.clearEventName();
|
|
|
this.history.save();
|
|
|
this.renderer.autoRedraw();
|
|
|
}
|
|
|
break;
|
|
|
case VectorEvents.MinusCrossPoint:
|
|
|
- if (selectItem && selectItem.dir && selectItem.vectorId) {
|
|
|
+ if (selectItem && selectItem.vectorId) {
|
|
|
const curvePoint = dataService.getCurveRoadPoint(selectItem.vectorId);
|
|
|
const curveRoad = dataService.getCurveRoad(curvePoint.parent);
|
|
|
- curveRoadService.subCPoint(curveRoad, curvePoint.getIndex());
|
|
|
- stateService.clearEventName();
|
|
|
+ if (curveRoad.points.length > 3) {
|
|
|
+ curveRoadService.subCPoint(curveRoad, curvePoint.getIndex());
|
|
|
+ curveRoadService.setLanes(curveRoad.vectorId);
|
|
|
+ stateService.clearEventName();
|
|
|
+ }
|
|
|
this.history.save();
|
|
|
this.renderer.autoRedraw();
|
|
|
}
|