|
@@ -312,13 +312,11 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
elementService.hideAll();
|
|
|
+ //鼠标样式
|
|
|
elementService.setPoint(position);
|
|
|
elementService.showPoint();
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
- elementService.execute(listenLayer.modifyPoint, position);
|
|
|
- }
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddLine:
|
|
|
needAutoRedraw = true;
|
|
@@ -329,13 +327,10 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
elementService.hideAll();
|
|
|
elementService.setPoint(position);
|
|
|
elementService.showPoint();
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
- elementService.execute(listenLayer.modifyPoint, position);
|
|
|
- }
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddCurveLine:
|
|
|
needAutoRedraw = true;
|
|
@@ -346,13 +341,10 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
elementService.hideAll();
|
|
|
elementService.setPoint(position);
|
|
|
elementService.showPoint();
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
- elementService.execute(listenLayer.modifyPoint, position);
|
|
|
- }
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddCircle:
|
|
|
needAutoRedraw = true;
|
|
@@ -363,13 +355,10 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
elementService.hideAll();
|
|
|
elementService.setPoint(position);
|
|
|
elementService.showPoint();
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
- elementService.execute(listenLayer.modifyPoint, position);
|
|
|
- }
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddingRoad:
|
|
|
needAutoRedraw = true;
|
|
@@ -393,6 +382,8 @@ export default class Layer {
|
|
|
} else {
|
|
|
elementService.setNewRoadState("normal");
|
|
|
}
|
|
|
+ elementService.showPoint();
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddingLine:
|
|
|
needAutoRedraw = true;
|
|
@@ -412,13 +403,17 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
- elementService.execute(addLine.startInfo.position, position);
|
|
|
- elementService.setPoint(position);
|
|
|
+ // elementService.execute(addLine.startInfo.position, position);
|
|
|
+ // elementService.setPoint(position);
|
|
|
if (addLine.newLine == null) {
|
|
|
addLine.buildLine(position);
|
|
|
} else {
|
|
|
addLine.updateLine(position);
|
|
|
}
|
|
|
+ elementService.hideAll();
|
|
|
+ elementService.setPoint(position);
|
|
|
+ elementService.showPoint();
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddingCurveLine:
|
|
|
needAutoRedraw = true;
|
|
@@ -438,13 +433,17 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
- elementService.execute(addLine.startInfo.position, position);
|
|
|
- elementService.setPoint(position);
|
|
|
+ // elementService.execute(addLine.startInfo.position, position);
|
|
|
+ // elementService.setPoint(position);
|
|
|
if (addLine.newLine == null) {
|
|
|
addLine.buildCurveLine(position);
|
|
|
} else {
|
|
|
addLine.updateCurveLine(position);
|
|
|
}
|
|
|
+ elementService.hideAll();
|
|
|
+ elementService.setPoint(position);
|
|
|
+ elementService.showPoint();
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddingCircle:
|
|
|
needAutoRedraw = true;
|
|
@@ -459,13 +458,17 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
- elementService.execute(addCircle.center, position);
|
|
|
- elementService.setPoint(position);
|
|
|
+ // elementService.execute(addCircle.center, position);
|
|
|
+ // elementService.setPoint(position);
|
|
|
if (addCircle.newCircle == null) {
|
|
|
addCircle.buildCircle(position);
|
|
|
} else {
|
|
|
addCircle.updateCircle(position);
|
|
|
}
|
|
|
+ elementService.hideAll();
|
|
|
+ elementService.setPoint(position);
|
|
|
+ elementService.showPoint();
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.MoveRoad:
|
|
|
needAutoRedraw = true;
|
|
@@ -506,36 +509,7 @@ export default class Layer {
|
|
|
if (!flag) {
|
|
|
elementService.hideAll();
|
|
|
} else {
|
|
|
- // point = dataService.getRoadPoint(draggingItem.vectorId);
|
|
|
- // listenLayer.start(point, {
|
|
|
- // exceptRoadPointId: draggingItem.vectorId,
|
|
|
- // exceptRoadIds: point.parent,
|
|
|
- // });
|
|
|
- let otherPoint = null;
|
|
|
- if (
|
|
|
- listenLayer.modifyPoint &&
|
|
|
- listenLayer.modifyPoint.linkedRoadPointId
|
|
|
- ) {
|
|
|
- otherPoint = dataService.getRoadPoint(
|
|
|
- listenLayer.modifyPoint.linkedRoadPointId
|
|
|
- );
|
|
|
- } else if (
|
|
|
- listenLayer.modifyPoint &&
|
|
|
- listenLayer.modifyPoint.linkedRoadPointIdX
|
|
|
- ) {
|
|
|
- otherPoint = dataService.getRoadPoint(
|
|
|
- listenLayer.modifyPoint.linkedRoadPointIdX
|
|
|
- );
|
|
|
- } else if (
|
|
|
- listenLayer.modifyPoint &&
|
|
|
- listenLayer.modifyPoint.linkedRoadPointIdY
|
|
|
- ) {
|
|
|
- otherPoint = dataService.getRoadPoint(
|
|
|
- listenLayer.modifyPoint.linkedRoadPointIdY
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- elementService.execute(otherPoint, point);
|
|
|
+ this.showElementLine(point);
|
|
|
}
|
|
|
needAutoRedraw = true;
|
|
|
break;
|
|
@@ -548,13 +522,10 @@ export default class Layer {
|
|
|
y: listenLayer.modifyPoint.y,
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
elementService.hideAll();
|
|
|
elementService.setPoint(position);
|
|
|
elementService.showPoint();
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
- elementService.execute(listenLayer.modifyPoint, position);
|
|
|
- }
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.AddingCurveRoad:
|
|
|
needAutoRedraw = true;
|
|
@@ -578,6 +549,8 @@ export default class Layer {
|
|
|
} else {
|
|
|
elementService.setNewRoadState("normal");
|
|
|
}
|
|
|
+ elementService.showPoint();
|
|
|
+ this.showElementLine(position);
|
|
|
break;
|
|
|
case LayerEvents.MoveCurveRoad:
|
|
|
needAutoRedraw = true;
|
|
@@ -603,6 +576,7 @@ export default class Layer {
|
|
|
};
|
|
|
}
|
|
|
moveRoad.moveCurveRoadPoint(draggingItem.vectorId, position);
|
|
|
+ this.showElementLine(point);
|
|
|
needAutoRedraw = true;
|
|
|
break;
|
|
|
case LayerEvents.MoveCrossPoint:
|
|
@@ -650,6 +624,7 @@ export default class Layer {
|
|
|
};
|
|
|
}
|
|
|
movePoint.movePoint(position, draggingItem.vectorId);
|
|
|
+ this.showElementLine(point);
|
|
|
needAutoRedraw = true;
|
|
|
}
|
|
|
break;
|
|
@@ -667,6 +642,7 @@ export default class Layer {
|
|
|
};
|
|
|
}
|
|
|
movePoint.moveCurvePoint(position, draggingItem.vectorId);
|
|
|
+ this.showElementLine(curvePoint);
|
|
|
needAutoRedraw = true;
|
|
|
}
|
|
|
break;
|
|
@@ -941,7 +917,7 @@ export default class Layer {
|
|
|
needAutoRedraw = true;
|
|
|
if (draggingItem && draggingItem.vectorId) {
|
|
|
movePoint.finish(draggingItem.vectorId);
|
|
|
- uiService.setPointCategory(VectorCategory.Point.NormalPoint);
|
|
|
+ uiService.setSelectPointCategory(VectorCategory.Point.NormalPoint);
|
|
|
}
|
|
|
this.history.save();
|
|
|
break;
|
|
@@ -960,12 +936,11 @@ export default class Layer {
|
|
|
case LayerEvents.AddPoint:
|
|
|
if (
|
|
|
Settings.selectBasePointId != null &&
|
|
|
- (Settings.locationMode == Constant.angleLocationMode ||
|
|
|
- Settings.locationMode == Constant.allLocationMode)
|
|
|
+ (Settings.selectLocationMode == Constant.angleLocationMode ||
|
|
|
+ Settings.selectLocationMode == Constant.allLocationMode)
|
|
|
) {
|
|
|
this.uiControl.showConfirm();
|
|
|
needAutoRedraw = true;
|
|
|
- this.history.save();
|
|
|
elementService.hideAll();
|
|
|
}
|
|
|
break;
|
|
@@ -1244,7 +1219,7 @@ export default class Layer {
|
|
|
if (Settings.isMobile) {
|
|
|
stateService.clearEventName();
|
|
|
this.exit();
|
|
|
- uiService.setLineCategory(VectorCategory.Line.NormalLine);
|
|
|
+ uiService.setSelectLineCategory(VectorCategory.Line.NormalLine);
|
|
|
} else {
|
|
|
stateService.setEventName(LayerEvents.AddLine);
|
|
|
}
|
|
@@ -1260,8 +1235,8 @@ export default class Layer {
|
|
|
} else if (
|
|
|
eventName == LayerEvents.AddPoint &&
|
|
|
Settings.selectBasePointId != null &&
|
|
|
- (Settings.locationMode == Constant.angleLocationMode ||
|
|
|
- Settings.locationMode == Constant.allLocationMode)
|
|
|
+ (Settings.selectLocationMode == Constant.angleLocationMode ||
|
|
|
+ Settings.selectLocationMode == Constant.allLocationMode)
|
|
|
) {
|
|
|
} else {
|
|
|
stateService.clearEventName();
|
|
@@ -1313,4 +1288,76 @@ export default class Layer {
|
|
|
this.uiControl.graphicStateUI.existsBaseLine = false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ showElementLine(point) {
|
|
|
+ let otherPoint1 = null;
|
|
|
+ let otherPoint2 = null;
|
|
|
+ if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdX) {
|
|
|
+ otherPoint1 = dataService.getRoadPoint(
|
|
|
+ listenLayer.modifyPoint.linkedRoadPointIdX
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdX
|
|
|
+ ) {
|
|
|
+ otherPoint1 = dataService.getCurveRoadPoint(
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdX
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedPointIdX
|
|
|
+ ) {
|
|
|
+ otherPoint1 = dataService.getPoint(
|
|
|
+ listenLayer.modifyPoint.linkedPointIdX
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdX
|
|
|
+ ) {
|
|
|
+ otherPoint1 = dataService.getCurvePoint(
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdX
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdY) {
|
|
|
+ otherPoint2 = dataService.getRoadPoint(
|
|
|
+ listenLayer.modifyPoint.linkedRoadPointIdY
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdY
|
|
|
+ ) {
|
|
|
+ otherPoint2 = dataService.getCurveRoadPoint(
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdY
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedPointIdY
|
|
|
+ ) {
|
|
|
+ otherPoint2 = dataService.getPoint(
|
|
|
+ listenLayer.modifyPoint.linkedPointIdY
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdY
|
|
|
+ ) {
|
|
|
+ otherPoint2 = dataService.getCurvePoint(
|
|
|
+ listenLayer.modifyPoint.linkedCurvePointIdY
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ let otherPoint = {};
|
|
|
+ if (otherPoint1) {
|
|
|
+ otherPoint.x = otherPoint1.x;
|
|
|
+ otherPoint.y = otherPoint1.y;
|
|
|
+ }
|
|
|
+ if (otherPoint2) {
|
|
|
+ otherPoint.y = otherPoint2.y;
|
|
|
+ if (!otherPoint.hasOwnProperty("x")) {
|
|
|
+ otherPoint.x = otherPoint2.x;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ elementService.execute(otherPoint, point);
|
|
|
+ }
|
|
|
}
|