|
@@ -1,4 +1,4 @@
|
|
|
-import { mathUtil } from "./Util/MathUtil";
|
|
|
+import MathUtil, { mathUtil } from "./Util/MathUtil";
|
|
|
import { dataService } from "./Service/DataService.js";
|
|
|
import { stateService } from "./Service/StateService.js";
|
|
|
import { roadService } from "./Service/RoadService.js";
|
|
@@ -64,37 +64,18 @@ export default class ListenLayer {
|
|
|
}
|
|
|
this.clear();
|
|
|
if (!vType || vType == VectorType.CurveRoad) {
|
|
|
- selectInfo.curveRoadEdgeInfo = this.isSelectCurveRoad(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCurveRoadId
|
|
|
- ); //包括edge
|
|
|
- selectInfo.curveRoadPointInfo = this.isSelectCurveRoadPoint(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCurveRoadPointId
|
|
|
- );
|
|
|
+ selectInfo.curveRoadEdgeInfo = this.isSelectCurveRoad(position, exceptVectorIds.exceptCurveRoadId); //包括edge
|
|
|
+ selectInfo.curveRoadPointInfo = this.isSelectCurveRoadPoint(position, exceptVectorIds.exceptCurveRoadPointId);
|
|
|
}
|
|
|
|
|
|
if (!vType || vType == VectorType.Road) {
|
|
|
- selectInfo.roadEdgeInfo = this.isSelectRoad(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptRoadIds
|
|
|
- ); //包括edge
|
|
|
- selectInfo.roadPointInfo = this.isSelectRoadPoint(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptRoadPointId
|
|
|
- );
|
|
|
+ selectInfo.roadEdgeInfo = this.isSelectRoad(position, exceptVectorIds.exceptRoadIds); //包括edge
|
|
|
+ selectInfo.roadPointInfo = this.isSelectRoadPoint(position, exceptVectorIds.exceptRoadPointId);
|
|
|
}
|
|
|
|
|
|
if (!vType || vType == VectorType.Line) {
|
|
|
- selectInfo.lineInfo = this.isSelectLine(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptLineIds
|
|
|
- );
|
|
|
- selectInfo.pointInfo = this.isSelectPoint(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptPointId,
|
|
|
- exceptVectorIds.exceptLineIds
|
|
|
- );
|
|
|
+ selectInfo.lineInfo = this.isSelectLine(position, exceptVectorIds.exceptLineIds);
|
|
|
+ selectInfo.pointInfo = this.isSelectPoint(position, exceptVectorIds.exceptPointId, exceptVectorIds.exceptLineIds);
|
|
|
}
|
|
|
// selectInfo.pointInfo = this.isSelectPoint(
|
|
|
// position,
|
|
@@ -102,44 +83,23 @@ export default class ListenLayer {
|
|
|
// );
|
|
|
|
|
|
if (!vType || vType == VectorType.CurveLine) {
|
|
|
- selectInfo.curvePointInfo = this.isSelectCurvePoint(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCurvePointId
|
|
|
- );
|
|
|
- selectInfo.curveLineInfo = this.isSelectCurveLine(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCurveLineId
|
|
|
- );
|
|
|
+ selectInfo.curvePointInfo = this.isSelectCurvePoint(position, exceptVectorIds.exceptCurvePointId);
|
|
|
+ selectInfo.curveLineInfo = this.isSelectCurveLine(position, exceptVectorIds.exceptCurveLineId);
|
|
|
}
|
|
|
|
|
|
//if (!vType || vType == VectorType.Circle) {
|
|
|
- selectInfo.circleInfo = this.isSelectCircle(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCircleId
|
|
|
- );
|
|
|
+ selectInfo.circleInfo = this.isSelectCircle(position, exceptVectorIds.exceptCircleId);
|
|
|
//}
|
|
|
|
|
|
//if (!vType) {
|
|
|
//交叉口拐弯处的控制点
|
|
|
- selectInfo.crossPointInfo = this.isSelectCrossCrossPoint(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptCrossCrossPointId
|
|
|
- );
|
|
|
- selectInfo.textInfo = this.isSelectText(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptTextId
|
|
|
- );
|
|
|
- selectInfo.magnifierInfo = this.isSelectMagnifier(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptMagnifierId
|
|
|
- );
|
|
|
+ selectInfo.crossPointInfo = this.isSelectCrossCrossPoint(position, exceptVectorIds.exceptCrossCrossPointId);
|
|
|
+ selectInfo.textInfo = this.isSelectText(position, exceptVectorIds.exceptTextId);
|
|
|
+ selectInfo.magnifierInfo = this.isSelectMagnifier(position, exceptVectorIds.exceptMagnifierId);
|
|
|
//
|
|
|
|
|
|
if (!vType || vType == VectorType.SVG) {
|
|
|
- selectInfo.svgInfo = this.isSelectSVG(
|
|
|
- position,
|
|
|
- exceptVectorIds.exceptSVGId
|
|
|
- );
|
|
|
+ selectInfo.svgInfo = this.isSelectSVG(position, exceptVectorIds.exceptSVGId);
|
|
|
}
|
|
|
|
|
|
this.setModifyPoint(position, selectInfo);
|
|
@@ -179,19 +139,11 @@ export default class ListenLayer {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (
|
|
|
- (Math.abs(position.x - curvePoint.x) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.x - curvePoint.x) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedCurvePointIdX = curvePointId;
|
|
|
seqInfo.x = curvePoint.x;
|
|
|
}
|
|
|
- if (
|
|
|
- (Math.abs(position.y - curvePoint.y) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.y - curvePoint.y) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedPointIdY = curvePointId;
|
|
|
seqInfo.y = curvePoint.y;
|
|
|
}
|
|
@@ -200,9 +152,7 @@ export default class ListenLayer {
|
|
|
|
|
|
if (curvePointInfo.curvePointId) {
|
|
|
curvePointInfo.linkedCurvePointId = curvePointInfo.curvePointId;
|
|
|
- const linkedCurvePoint = dataService.getCurvePoint(
|
|
|
- curvePointInfo.curvePointId
|
|
|
- );
|
|
|
+ const linkedCurvePoint = dataService.getCurvePoint(curvePointInfo.curvePointId);
|
|
|
curvePointInfo.x = linkedCurvePoint.x;
|
|
|
curvePointInfo.y = linkedCurvePoint.y;
|
|
|
} else {
|
|
@@ -214,16 +164,10 @@ export default class ListenLayer {
|
|
|
curvePointInfo.linkedCurvePointIdY = seqInfo.linkedCurvePointIdY;
|
|
|
curvePointInfo.y = seqInfo.y;
|
|
|
}
|
|
|
- if (
|
|
|
- curvePointInfo.hasOwnProperty("y") &&
|
|
|
- !curvePointInfo.hasOwnProperty("x")
|
|
|
- ) {
|
|
|
+ if (curvePointInfo.hasOwnProperty("y") && !curvePointInfo.hasOwnProperty("x")) {
|
|
|
curvePointInfo.x = position.x;
|
|
|
}
|
|
|
- if (
|
|
|
- curvePointInfo.hasOwnProperty("x") &&
|
|
|
- !curvePointInfo.hasOwnProperty("y")
|
|
|
- ) {
|
|
|
+ if (curvePointInfo.hasOwnProperty("x") && !curvePointInfo.hasOwnProperty("y")) {
|
|
|
curvePointInfo.y = position.y;
|
|
|
}
|
|
|
}
|
|
@@ -238,20 +182,12 @@ export default class ListenLayer {
|
|
|
};
|
|
|
const curveLines = dataService.getCurveLines();
|
|
|
for (const curveLineId in curveLines) {
|
|
|
- if (
|
|
|
- exceptCurveLineIds &&
|
|
|
- (exceptCurveLineIds.hasOwnProperty(curveLineId) ||
|
|
|
- exceptCurveLineIds == curveLineId)
|
|
|
- ) {
|
|
|
+ if (exceptCurveLineIds && (exceptCurveLineIds.hasOwnProperty(curveLineId) || exceptCurveLineIds == curveLineId)) {
|
|
|
continue;
|
|
|
}
|
|
|
const curveLine = dataService.getCurveLine(curveLineId);
|
|
|
|
|
|
- let joinInfo = this.distanceForBezier(
|
|
|
- position,
|
|
|
- curveLine.curves,
|
|
|
- Constant.minAdsorbPix
|
|
|
- );
|
|
|
+ let joinInfo = this.distanceForBezier(position, curveLine.curves, Constant.minAdsorbPix);
|
|
|
//选中了路
|
|
|
if (joinInfo.distance < Constant.minAdsorbPix) {
|
|
|
curveLineInfo = {
|
|
@@ -315,19 +251,11 @@ export default class ListenLayer {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (
|
|
|
- (Math.abs(position.x - point.x) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.x - point.x) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedPointIdX = pointId;
|
|
|
seqInfo.x = point.x;
|
|
|
}
|
|
|
- if (
|
|
|
- (Math.abs(position.y - point.y) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.y - point.y) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedPointIdY = pointId;
|
|
|
seqInfo.y = point.y;
|
|
|
}
|
|
@@ -380,8 +308,7 @@ export default class ListenLayer {
|
|
|
line.getCategory() == VectorCategory.Line.ExtendedPositionLine ||
|
|
|
line.getCategory() == VectorCategory.Line.GuideLocationLine ||
|
|
|
line.getCategory() == VectorCategory.Line.GuidePositionLine ||
|
|
|
- (line.getCategory() == VectorCategory.Line.PositionLine &&
|
|
|
- line.getLocationMode() != Constant.angleLocationMode)
|
|
|
+ (line.getCategory() == VectorCategory.Line.PositionLine && line.getLocationMode() != Constant.angleLocationMode)
|
|
|
) {
|
|
|
continue;
|
|
|
}
|
|
@@ -459,12 +386,7 @@ export default class ListenLayer {
|
|
|
// };
|
|
|
// }
|
|
|
// }
|
|
|
- const flag = mathUtil.isPointInElliptic(
|
|
|
- position,
|
|
|
- circle.center,
|
|
|
- circle.radiusX,
|
|
|
- circle.radiusY
|
|
|
- );
|
|
|
+ const flag = mathUtil.isPointInElliptic(position, circle.center, circle.radiusX, circle.radiusY);
|
|
|
if (flag) {
|
|
|
circleInfo = {
|
|
|
circleId: circleId,
|
|
@@ -511,18 +433,10 @@ export default class ListenLayer {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (
|
|
|
- (Math.abs(position.x - roadPoint.x) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.x - roadPoint.x) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedRoadPointIdX = roadPointId;
|
|
|
seqInfo.x = roadPoint.x;
|
|
|
- } else if (
|
|
|
- (Math.abs(position.y - roadPoint.y) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ } else if ((Math.abs(position.y - roadPoint.y) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedRoadPointIdY = roadPointId;
|
|
|
seqInfo.y = roadPoint.y;
|
|
|
}
|
|
@@ -545,16 +459,10 @@ export default class ListenLayer {
|
|
|
roadPointInfo.y = seqInfo.y;
|
|
|
}
|
|
|
|
|
|
- if (
|
|
|
- roadPointInfo.hasOwnProperty("y") &&
|
|
|
- !roadPointInfo.hasOwnProperty("x")
|
|
|
- ) {
|
|
|
+ if (roadPointInfo.hasOwnProperty("y") && !roadPointInfo.hasOwnProperty("x")) {
|
|
|
roadPointInfo.x = position.x;
|
|
|
}
|
|
|
- if (
|
|
|
- roadPointInfo.hasOwnProperty("x") &&
|
|
|
- !roadPointInfo.hasOwnProperty("y")
|
|
|
- ) {
|
|
|
+ if (roadPointInfo.hasOwnProperty("x") && !roadPointInfo.hasOwnProperty("y")) {
|
|
|
roadPointInfo.y = position.y;
|
|
|
}
|
|
|
}
|
|
@@ -594,18 +502,10 @@ export default class ListenLayer {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (
|
|
|
- (Math.abs(position.x - curveRoadPoint.x) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ if ((Math.abs(position.x - curveRoadPoint.x) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedCurveRoadPointIdX = curveRoadPointId;
|
|
|
seqInfo.x = curveRoadPoint.x;
|
|
|
- } else if (
|
|
|
- (Math.abs(position.y - curveRoadPoint.y) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom <
|
|
|
- Constant.minAdsorbPix
|
|
|
- ) {
|
|
|
+ } else if ((Math.abs(position.y - curveRoadPoint.y) * coordinate.zoom) / coordinate.defaultZoom < Constant.minAdsorbPix) {
|
|
|
seqInfo.linkedCurveRoadPointIdY = curveRoadPointId;
|
|
|
seqInfo.y = curveRoadPoint.y;
|
|
|
}
|
|
@@ -613,33 +513,22 @@ export default class ListenLayer {
|
|
|
}
|
|
|
|
|
|
if (curveRoadPointInfo.curveRoadPointId) {
|
|
|
- curveRoadPointInfo.linkedCurveRoadPointId =
|
|
|
- curveRoadPointInfo.curveRoadPointId;
|
|
|
- const linkedCurvePoint = dataService.getCurveRoadPoint(
|
|
|
- curveRoadPointInfo.curveRoadPointId
|
|
|
- );
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointId = curveRoadPointInfo.curveRoadPointId;
|
|
|
+ const linkedCurvePoint = dataService.getCurveRoadPoint(curveRoadPointInfo.curveRoadPointId);
|
|
|
curveRoadPointInfo.x = linkedCurvePoint.x;
|
|
|
curveRoadPointInfo.y = linkedCurvePoint.y;
|
|
|
} else {
|
|
|
if (seqInfo.hasOwnProperty("linkedCurveRoadPointIdX")) {
|
|
|
- curveRoadPointInfo.linkedCurveRoadPointIdX =
|
|
|
- seqInfo.linkedCurveRoadPointIdX;
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointIdX = seqInfo.linkedCurveRoadPointIdX;
|
|
|
curveRoadPointInfo.x = seqInfo.x;
|
|
|
} else if (seqInfo.hasOwnProperty("linkedCurveRoadPointIdY")) {
|
|
|
- curveRoadPointInfo.linkedCurveRoadPointIdY =
|
|
|
- seqInfo.linkedCurveRoadPointIdY;
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointIdY = seqInfo.linkedCurveRoadPointIdY;
|
|
|
curveRoadPointInfo.y = seqInfo.y;
|
|
|
}
|
|
|
- if (
|
|
|
- curveRoadPointInfo.hasOwnProperty("y") &&
|
|
|
- !curveRoadPointInfo.hasOwnProperty("x")
|
|
|
- ) {
|
|
|
+ if (curveRoadPointInfo.hasOwnProperty("y") && !curveRoadPointInfo.hasOwnProperty("x")) {
|
|
|
curveRoadPointInfo.x = position.x;
|
|
|
}
|
|
|
- if (
|
|
|
- curveRoadPointInfo.hasOwnProperty("x") &&
|
|
|
- !curveRoadPointInfo.hasOwnProperty("y")
|
|
|
- ) {
|
|
|
+ if (curveRoadPointInfo.hasOwnProperty("x") && !curveRoadPointInfo.hasOwnProperty("y")) {
|
|
|
curveRoadPointInfo.y = position.y;
|
|
|
}
|
|
|
}
|
|
@@ -676,25 +565,13 @@ export default class ListenLayer {
|
|
|
let rightLine = mathUtil.createLine1(rightEdge.start, rightEdge.end);
|
|
|
let rightJoin = mathUtil.getJoinLinePoint(position, rightLine);
|
|
|
|
|
|
- let leftSideLine = leftEdge.roadSide
|
|
|
- ? mathUtil.createLine1(leftEdge.roadSide.start, leftEdge.roadSide.end)
|
|
|
- : null;
|
|
|
- let leftSideJoin = leftSideLine
|
|
|
- ? mathUtil.getJoinLinePoint(position, leftSideLine)
|
|
|
- : null;
|
|
|
-
|
|
|
- let rightSideLine = rightEdge.roadSide
|
|
|
- ? mathUtil.createLine1(rightEdge.roadSide.start, rightEdge.roadSide.end)
|
|
|
- : null;
|
|
|
- let rightSideJoin = rightSideLine
|
|
|
- ? mathUtil.getJoinLinePoint(position, rightSideLine)
|
|
|
- : null;
|
|
|
+ let leftSideLine = leftEdge.roadSide ? mathUtil.createLine1(leftEdge.roadSide.start, leftEdge.roadSide.end) : null;
|
|
|
+ let leftSideJoin = leftSideLine ? mathUtil.getJoinLinePoint(position, leftSideLine) : null;
|
|
|
+
|
|
|
+ let rightSideLine = rightEdge.roadSide ? mathUtil.createLine1(rightEdge.roadSide.start, rightEdge.roadSide.end) : null;
|
|
|
+ let rightSideJoin = rightSideLine ? mathUtil.getJoinLinePoint(position, rightSideLine) : null;
|
|
|
let distance = this.getDistance(position, join);
|
|
|
- if (
|
|
|
- mathUtil.isContainForSegment(join, startPoint, endPoint) &&
|
|
|
- (mathUtil.isContainForSegment(position, join, leftJoin) ||
|
|
|
- mathUtil.isContainForSegment(position, join, rightJoin))
|
|
|
- ) {
|
|
|
+ if (mathUtil.isContainForSegment(join, startPoint, endPoint) && (mathUtil.isContainForSegment(position, join, leftJoin) || mathUtil.isContainForSegment(position, join, rightJoin))) {
|
|
|
if (!roadInfo.roadId || distance < roadInfo.distance) {
|
|
|
roadInfo = {
|
|
|
roadId: roadId,
|
|
@@ -726,11 +603,8 @@ export default class ListenLayer {
|
|
|
|
|
|
distance = this.getDistance(position, leftJoin);
|
|
|
if (
|
|
|
- (mathUtil.isContainForSegment(leftJoin, leftEdge.start, leftEdge.end) &&
|
|
|
- distance < Constant.minAdsorbPix / 2) ||
|
|
|
- (mathUtil.isContainForSegment(join, startPoint, endPoint) &&
|
|
|
- leftSideJoin &&
|
|
|
- mathUtil.isContainForSegment(position, leftSideJoin, leftJoin))
|
|
|
+ (mathUtil.isContainForSegment(leftJoin, leftEdge.start, leftEdge.end) && distance < Constant.minAdsorbPix / 2) ||
|
|
|
+ (mathUtil.isContainForSegment(join, startPoint, endPoint) && leftSideJoin && mathUtil.isContainForSegment(position, leftSideJoin, leftJoin))
|
|
|
) {
|
|
|
if (!edgeInfo.edgeId || distance < edgeInfo.distance) {
|
|
|
edgeInfo = {
|
|
@@ -745,15 +619,8 @@ export default class ListenLayer {
|
|
|
distance = this.getDistance(position, rightJoin);
|
|
|
|
|
|
if (
|
|
|
- (mathUtil.isContainForSegment(
|
|
|
- rightJoin,
|
|
|
- rightEdge.start,
|
|
|
- rightEdge.end
|
|
|
- ) &&
|
|
|
- distance < Constant.minAdsorbPix / 2) ||
|
|
|
- (mathUtil.isContainForSegment(join, startPoint, endPoint) &&
|
|
|
- rightSideJoin &&
|
|
|
- mathUtil.isContainForSegment(position, rightSideJoin, rightJoin))
|
|
|
+ (mathUtil.isContainForSegment(rightJoin, rightEdge.start, rightEdge.end) && distance < Constant.minAdsorbPix / 2) ||
|
|
|
+ (mathUtil.isContainForSegment(join, startPoint, endPoint) && rightSideJoin && mathUtil.isContainForSegment(position, rightSideJoin, rightJoin))
|
|
|
) {
|
|
|
if (!edgeInfo.edgeId || distance < edgeInfo.distance) {
|
|
|
edgeInfo = {
|
|
@@ -766,16 +633,10 @@ export default class ListenLayer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (
|
|
|
- roadInfo.roadId &&
|
|
|
- (!edgeInfo.edgeId || roadInfo.distance < edgeInfo.distance)
|
|
|
- ) {
|
|
|
+ if (roadInfo.roadId && (!edgeInfo.edgeId || roadInfo.distance < edgeInfo.distance)) {
|
|
|
const linkedRoad = dataService.getRoad(roadInfo.roadId);
|
|
|
const linkedRoadLine = roadService.getMidLine(linkedRoad);
|
|
|
- const linkedPosition = mathUtil.getJoinLinePoint(
|
|
|
- position,
|
|
|
- linkedRoadLine
|
|
|
- );
|
|
|
+ const linkedPosition = mathUtil.getJoinLinePoint(position, linkedRoadLine);
|
|
|
|
|
|
roadInfo.x = linkedPosition.x;
|
|
|
roadInfo.y = linkedPosition.y;
|
|
@@ -839,33 +700,14 @@ export default class ListenLayer {
|
|
|
console.log("isSelectCurveRoad:" + JSON.stringify(joinInfo));
|
|
|
//检查edge
|
|
|
const leftCurveEdge = dataService.getCurveRoadEdge(curveRoad.leftEdgeId);
|
|
|
- const leftJoinInfo = this.distanceForBezier(
|
|
|
- position,
|
|
|
- leftCurveEdge.curves,
|
|
|
- Constant.minAdsorbPix
|
|
|
- );
|
|
|
+ const leftJoinInfo = this.distanceForBezier(position, leftCurveEdge.curves, Constant.minAdsorbPix);
|
|
|
|
|
|
- const rightCurveEdge = dataService.getCurveRoadEdge(
|
|
|
- curveRoad.rightEdgeId
|
|
|
- );
|
|
|
- const rightJoinInfo = this.distanceForBezier(
|
|
|
- position,
|
|
|
- rightCurveEdge.curves,
|
|
|
- Constant.minAdsorbPix
|
|
|
- );
|
|
|
+ const rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
|
|
|
+ const rightJoinInfo = this.distanceForBezier(position, rightCurveEdge.curves, Constant.minAdsorbPix);
|
|
|
|
|
|
- let line1 = mathUtil.createLine1(
|
|
|
- joinInfo.position,
|
|
|
- leftJoinInfo.position
|
|
|
- );
|
|
|
+ let line1 = mathUtil.createLine1(joinInfo.position, leftJoinInfo.position);
|
|
|
let position1 = mathUtil.getJoinLinePoint(position, line1);
|
|
|
- if (
|
|
|
- mathUtil.isContainForSegment(
|
|
|
- position1,
|
|
|
- joinInfo.position,
|
|
|
- leftJoinInfo.position
|
|
|
- )
|
|
|
- ) {
|
|
|
+ if (mathUtil.isContainForSegment(position1, joinInfo.position, leftJoinInfo.position)) {
|
|
|
if (joinInfo.distance < curveRoad.leftWidth) {
|
|
|
curveRoadInfo = {
|
|
|
curveRoadId: curveRoadId,
|
|
@@ -877,19 +719,10 @@ export default class ListenLayer {
|
|
|
}
|
|
|
curveRoadInfo.dir = "left";
|
|
|
} else {
|
|
|
- let line2 = mathUtil.createLine1(
|
|
|
- joinInfo.position,
|
|
|
- rightJoinInfo.position
|
|
|
- );
|
|
|
+ let line2 = mathUtil.createLine1(joinInfo.position, rightJoinInfo.position);
|
|
|
|
|
|
let position2 = mathUtil.getJoinLinePoint(position, line2);
|
|
|
- if (
|
|
|
- mathUtil.isContainForSegment(
|
|
|
- position2,
|
|
|
- joinInfo.position,
|
|
|
- rightJoinInfo.position
|
|
|
- )
|
|
|
- ) {
|
|
|
+ if (mathUtil.isContainForSegment(position2, joinInfo.position, rightJoinInfo.position)) {
|
|
|
if (joinInfo.distance < curveRoad.rightWidth) {
|
|
|
curveRoadInfo = {
|
|
|
curveRoadId: curveRoadId,
|
|
@@ -904,10 +737,7 @@ export default class ListenLayer {
|
|
|
}
|
|
|
|
|
|
if (leftJoinInfo.distance < Constant.minAdsorbPix) {
|
|
|
- const index = mathUtil.getCurvesIndexForCurvesPoints(
|
|
|
- leftJoinInfo.position,
|
|
|
- curveRoad.points
|
|
|
- );
|
|
|
+ const index = mathUtil.getCurvesIndexForCurvesPoints(leftJoinInfo.position, curveRoad.points);
|
|
|
curveEdgeInfo = {
|
|
|
curveEdgeId: curveRoad.leftEdgeId,
|
|
|
type: VectorType.CurveRoadEdge,
|
|
@@ -917,10 +747,7 @@ export default class ListenLayer {
|
|
|
y: leftJoinInfo.position.y,
|
|
|
};
|
|
|
} else if (rightJoinInfo.distance < Constant.minAdsorbPix) {
|
|
|
- const index = mathUtil.getCurvesIndexForCurvesPoints(
|
|
|
- rightJoinInfo.position,
|
|
|
- curveRoad.points
|
|
|
- );
|
|
|
+ const index = mathUtil.getCurvesIndexForCurvesPoints(rightJoinInfo.position, curveRoad.points);
|
|
|
curveEdgeInfo = {
|
|
|
curveEdgeId: curveRoad.rightEdgeId,
|
|
|
type: VectorType.CurveRoadEdge,
|
|
@@ -931,11 +758,7 @@ export default class ListenLayer {
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- if (
|
|
|
- curveRoadInfo.curveRoadId &&
|
|
|
- (!curveEdgeInfo.curveEdgeId ||
|
|
|
- curveRoadInfo.distance < curveEdgeInfo.distance)
|
|
|
- ) {
|
|
|
+ if (curveRoadInfo.curveRoadId && (!curveEdgeInfo.curveEdgeId || curveRoadInfo.distance < curveEdgeInfo.distance)) {
|
|
|
// console.log("选中的CurveRoad:" + curveRoadInfo.curveRoadId);
|
|
|
return curveRoadInfo;
|
|
|
} else if (curveEdgeInfo.curveEdgeId) {
|
|
@@ -1020,6 +843,7 @@ export default class ListenLayer {
|
|
|
};
|
|
|
const svgs = dataService.getSVGs();
|
|
|
|
|
|
+ /**-----暴力做法 */
|
|
|
for (const svgId in svgs) {
|
|
|
if (svgId == exceptSVGId) {
|
|
|
continue;
|
|
@@ -1048,22 +872,91 @@ export default class ListenLayer {
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- if (svgInfo.svgId) {
|
|
|
- return svgInfo;
|
|
|
+ }
|
|
|
+ /**----- */
|
|
|
+
|
|
|
+ for (const svgId in svgs) {
|
|
|
+ if (svgId == exceptSVGId) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ const svg = dataService.getSVG(svgId);
|
|
|
+ let centerPoint = mathUtil.calculateCenterPoint(svg.points);
|
|
|
+
|
|
|
+ let newDistance = this.getDistance(position, centerPoint);
|
|
|
+ for (let i = 0; i < svg.points.length; ++i) {
|
|
|
+ let distance = this.getDistance(position, svg.points[i]);
|
|
|
+
|
|
|
+ // if (!svgInfo.svgId && distance < Constant.minAdsorbPix / 5) { //改大图例四个点的选择范围
|
|
|
+ if (!svgInfo.svgId && distance < Constant.minAdsorbPix / 2) {
|
|
|
+ svgInfo = {
|
|
|
+ svgId: svgId,
|
|
|
+ distance: distance,
|
|
|
+ newDistance: newDistance,
|
|
|
+ type: VectorType.SVG,
|
|
|
+ index: i,
|
|
|
+ x: position.x,
|
|
|
+ y: position.y,
|
|
|
+ };
|
|
|
+ } else if (svgInfo.svgId && distance < svgInfo.distance) {
|
|
|
+ svgInfo = {
|
|
|
+ svgId: svgId,
|
|
|
+ distance: distance,
|
|
|
+ newDistance: newDistance,
|
|
|
+ type: VectorType.SVG,
|
|
|
+ index: i,
|
|
|
+ x: position.x,
|
|
|
+ y: position.y,
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
+ // if (svgInfo.svgId) {
|
|
|
+ // return svgInfo;
|
|
|
+ // }
|
|
|
+
|
|
|
let flag = mathUtil.isPointInPoly(position, svg.points);
|
|
|
- if (flag) {
|
|
|
+ if (flag && !svgInfo.svgId) {
|
|
|
svgInfo = {
|
|
|
svgId: svgId,
|
|
|
type: VectorType.SVG,
|
|
|
x: position.x,
|
|
|
y: position.y,
|
|
|
index: -1,
|
|
|
+ newDistance: newDistance,
|
|
|
+ };
|
|
|
+ } else if (flag && newDistance < svgInfo.newDistance) {
|
|
|
+ svgInfo = {
|
|
|
+ svgId: svgId,
|
|
|
+ type: VectorType.SVG,
|
|
|
+ x: position.x,
|
|
|
+ y: position.y,
|
|
|
+ index: -1,
|
|
|
+ newDistance: newDistance,
|
|
|
};
|
|
|
- break;
|
|
|
}
|
|
|
+
|
|
|
+ // if (!svgInfo.svgId && newDistance < Constant.minAdsorbPix / 2) {
|
|
|
+ // svgInfo = {
|
|
|
+ // svgId: svgId,
|
|
|
+ // type: VectorType.SVG,
|
|
|
+ // x: position.x,
|
|
|
+ // y: position.y,
|
|
|
+ // index: -1,
|
|
|
+ // newDistance: newDistance,
|
|
|
+ // };
|
|
|
+ // break;
|
|
|
+ // } else if (svgInfo.svgId && newDistance < svgInfo.newDistance) {
|
|
|
+ // svgInfo = {
|
|
|
+ // svgId: svgId,
|
|
|
+ // type: VectorType.SVG,
|
|
|
+ // x: position.x,
|
|
|
+ // y: position.y,
|
|
|
+ // index: -1,
|
|
|
+ // newDistance: newDistance,
|
|
|
+ // };
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
}
|
|
|
- // console.error(svgInfo);
|
|
|
+
|
|
|
return svgInfo;
|
|
|
}
|
|
|
|
|
@@ -1145,10 +1038,7 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.index = info.circleInfo.index;
|
|
|
this.modifyPoint.x = info.circleInfo.x;
|
|
|
this.modifyPoint.y = info.circleInfo.y;
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- (info.pointInfo.pointId || info.curvePointInfo.curvePointId)
|
|
|
- ) {
|
|
|
+ } else if (info && (info.pointInfo.pointId || info.curvePointInfo.curvePointId)) {
|
|
|
this.modifyPoint = {};
|
|
|
if (info.pointInfo.pointId && info.curvePointInfo.curvePointId) {
|
|
|
if (info.pointInfo.distance < info.curvePointInfo.distance) {
|
|
@@ -1156,8 +1046,7 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.x = info.pointInfo.x;
|
|
|
this.modifyPoint.y = info.pointInfo.y;
|
|
|
} else {
|
|
|
- this.modifyPoint.linkedCurvePointId =
|
|
|
- info.curvePointInfo.curvePointId;
|
|
|
+ this.modifyPoint.linkedCurvePointId = info.curvePointInfo.curvePointId;
|
|
|
this.modifyPoint.x = info.curvePointInfo.x;
|
|
|
this.modifyPoint.y = info.curvePointInfo.y;
|
|
|
}
|
|
@@ -1170,10 +1059,7 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.x = info.curvePointInfo.x;
|
|
|
this.modifyPoint.y = info.curvePointInfo.y;
|
|
|
}
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- (info.lineInfo.lineId || info.curveLineInfo.curveLineId)
|
|
|
- ) {
|
|
|
+ } else if (info && (info.lineInfo.lineId || info.curveLineInfo.curveLineId)) {
|
|
|
this.modifyPoint = {};
|
|
|
if (info.lineInfo.lineId && info.curveLineInfo.curveLineId) {
|
|
|
if (info.lineInfo.distance < info.curveLineInfo.distance) {
|
|
@@ -1200,22 +1086,14 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.index = info.svgInfo.index;
|
|
|
this.modifyPoint.x = info.svgInfo.x;
|
|
|
this.modifyPoint.y = info.svgInfo.y;
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- (info.roadPointInfo.roadPointId ||
|
|
|
- info.curveRoadPointInfo.curveRoadPointId)
|
|
|
- ) {
|
|
|
- if (
|
|
|
- info.roadPointInfo.roadPointId &&
|
|
|
- info.curveRoadPointInfo.curveRoadPointId
|
|
|
- ) {
|
|
|
+ } else if (info && (info.roadPointInfo.roadPointId || info.curveRoadPointInfo.curveRoadPointId)) {
|
|
|
+ if (info.roadPointInfo.roadPointId && info.curveRoadPointInfo.curveRoadPointId) {
|
|
|
if (info.roadPointInfo.distance < info.curveRoadPointInfo.distance) {
|
|
|
this.modifyPoint.linkedRoadPointId = info.roadPointInfo.roadPointId;
|
|
|
this.modifyPoint.x = info.roadPointInfo.x;
|
|
|
this.modifyPoint.y = info.roadPointInfo.y;
|
|
|
} else {
|
|
|
- this.modifyPoint.linkedCurveRoadPointId =
|
|
|
- info.curveRoadPointInfo.curveRoadPointId;
|
|
|
+ this.modifyPoint.linkedCurveRoadPointId = info.curveRoadPointInfo.curveRoadPointId;
|
|
|
this.modifyPoint.x = info.curveRoadPointInfo.x;
|
|
|
this.modifyPoint.y = info.curveRoadPointInfo.y;
|
|
|
}
|
|
@@ -1224,15 +1102,11 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.x = info.roadPointInfo.x;
|
|
|
this.modifyPoint.y = info.roadPointInfo.y;
|
|
|
} else if (info.curveRoadPointInfo.curveRoadPointId) {
|
|
|
- this.modifyPoint.linkedCurveRoadPointId =
|
|
|
- info.curveRoadPointInfo.curveRoadPointId;
|
|
|
+ this.modifyPoint.linkedCurveRoadPointId = info.curveRoadPointInfo.curveRoadPointId;
|
|
|
this.modifyPoint.x = info.curveRoadPointInfo.x;
|
|
|
this.modifyPoint.y = info.curveRoadPointInfo.y;
|
|
|
}
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- (info.roadEdgeInfo.roadId || info.curveRoadEdgeInfo.curveRoadId)
|
|
|
- ) {
|
|
|
+ } else if (info && (info.roadEdgeInfo.roadId || info.curveRoadEdgeInfo.curveRoadId)) {
|
|
|
this.modifyPoint = {};
|
|
|
if (info.roadEdgeInfo.roadId && info.curveRoadEdgeInfo.curveRoadId) {
|
|
|
if (roadEdgeInfo.distance < info.curveRoadEdgeInfo.distance) {
|
|
@@ -1257,10 +1131,7 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.y = info.curveRoadEdgeInfo.y;
|
|
|
this.modifyPoint.dir = info.curveRoadEdgeInfo.dir;
|
|
|
}
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- (info.roadEdgeInfo.edgeId || info.curveRoadEdgeInfo.curveEdgeId)
|
|
|
- ) {
|
|
|
+ } else if (info && (info.roadEdgeInfo.edgeId || info.curveRoadEdgeInfo.curveEdgeId)) {
|
|
|
this.modifyPoint = {};
|
|
|
if (info.roadEdgeInfo.edgeId && info.curveRoadEdgeInfo.curveEdgeId) {
|
|
|
if (info.roadEdgeInfo.distance < info.curveRoadEdgeInfo.distance) {
|
|
@@ -1268,8 +1139,7 @@ export default class ListenLayer {
|
|
|
this.modifyPoint.x = info.roadEdgeInfo.x;
|
|
|
this.modifyPoint.y = info.roadEdgeInfo.y;
|
|
|
} else {
|
|
|
- this.modifyPoint.linkedCurveEdgeId =
|
|
|
- info.curveRoadEdgeInfo.curveEdgeId;
|
|
|
+ this.modifyPoint.linkedCurveEdgeId = info.curveRoadEdgeInfo.curveEdgeId;
|
|
|
this.modifyPoint.selectIndex = info.curveRoadEdgeInfo.selectIndex;
|
|
|
this.modifyPoint.x = info.curveRoadEdgeInfo.x;
|
|
|
this.modifyPoint.y = info.curveRoadEdgeInfo.y;
|
|
@@ -1286,57 +1156,40 @@ export default class ListenLayer {
|
|
|
}
|
|
|
} else if (info && info.crossPointInfo.crossCrossPointId) {
|
|
|
this.modifyPoint = {};
|
|
|
- this.modifyPoint.linkedCrossCrossPointId =
|
|
|
- info.crossPointInfo.crossCrossPointId;
|
|
|
+ this.modifyPoint.linkedCrossCrossPointId = info.crossPointInfo.crossCrossPointId;
|
|
|
this.modifyPoint.x = info.crossPointInfo.x;
|
|
|
this.modifyPoint.y = info.crossPointInfo.y;
|
|
|
} else if (info && info.roadPointInfo.linkedRoadPointIdX) {
|
|
|
this.modifyPoint = {};
|
|
|
- this.modifyPoint.linkedRoadPointIdX =
|
|
|
- info.roadPointInfo.linkedRoadPointIdX;
|
|
|
+ this.modifyPoint.linkedRoadPointIdX = info.roadPointInfo.linkedRoadPointIdX;
|
|
|
this.modifyPoint.x = info.roadPointInfo.x;
|
|
|
this.modifyPoint.y = info.roadPointInfo.y;
|
|
|
} else if (info && info.roadPointInfo.linkedRoadPointIdY) {
|
|
|
this.modifyPoint = {};
|
|
|
- this.modifyPoint.linkedRoadPointIdY =
|
|
|
- info.roadPointInfo.linkedRoadPointIdY;
|
|
|
+ this.modifyPoint.linkedRoadPointIdY = info.roadPointInfo.linkedRoadPointIdY;
|
|
|
this.modifyPoint.y = info.roadPointInfo.y;
|
|
|
this.modifyPoint.x = info.roadPointInfo.x;
|
|
|
} else if (info && info.curvePointInfo.linkedRoadPointIdX) {
|
|
|
this.modifyPoint = {};
|
|
|
- this.modifyPoint.linkedRoadPointIdX =
|
|
|
- info.curvePointInfo.linkedRoadPointIdX;
|
|
|
+ this.modifyPoint.linkedRoadPointIdX = info.curvePointInfo.linkedRoadPointIdX;
|
|
|
this.modifyPoint.x = info.curvePointInfo.x;
|
|
|
this.modifyPoint.y = position.y;
|
|
|
} else if (info && info.curvePointInfo.linkedRoadPointIdY) {
|
|
|
this.modifyPoint = {};
|
|
|
- this.modifyPoint.linkedRoadPointIdY =
|
|
|
- info.curvePointInfo.linkedRoadPointIdY;
|
|
|
+ this.modifyPoint.linkedRoadPointIdY = info.curvePointInfo.linkedRoadPointIdY;
|
|
|
this.modifyPoint.y = info.curvePointInfo.y;
|
|
|
this.modifyPoint.x = position.x;
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- info.pointInfo.linkedPointIdX &&
|
|
|
- !info.pointInfo.linkedPointIdY
|
|
|
- ) {
|
|
|
+ } else if (info && info.pointInfo.linkedPointIdX && !info.pointInfo.linkedPointIdY) {
|
|
|
this.modifyPoint = {};
|
|
|
this.modifyPoint.linkedPointIdX = info.pointInfo.linkedPointIdX;
|
|
|
this.modifyPoint.x = info.pointInfo.x;
|
|
|
this.modifyPoint.y = info.pointInfo.y;
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- info.pointInfo.linkedPointIdY &&
|
|
|
- !info.pointInfo.linkedPointIdX
|
|
|
- ) {
|
|
|
+ } else if (info && info.pointInfo.linkedPointIdY && !info.pointInfo.linkedPointIdX) {
|
|
|
this.modifyPoint = {};
|
|
|
this.modifyPoint.linkedPointIdY = info.pointInfo.linkedPointIdY;
|
|
|
this.modifyPoint.y = info.pointInfo.y;
|
|
|
this.modifyPoint.x = info.pointInfo.x;
|
|
|
- } else if (
|
|
|
- info &&
|
|
|
- info.pointInfo.linkedPointIdY &&
|
|
|
- info.pointInfo.linkedPointIdX
|
|
|
- ) {
|
|
|
+ } else if (info && info.pointInfo.linkedPointIdY && info.pointInfo.linkedPointIdX) {
|
|
|
this.modifyPoint = {};
|
|
|
this.modifyPoint.linkedPointIdX = info.pointInfo.linkedPointIdX;
|
|
|
this.modifyPoint.linkedPointIdY = info.pointInfo.linkedPointIdY;
|
|
@@ -1357,103 +1210,40 @@ export default class ListenLayer {
|
|
|
return false;
|
|
|
}
|
|
|
} else if (this.modifyPoint.linkedRoadPointId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedRoadPointId,
|
|
|
- VectorType.RoadPoint,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedRoadPointId, VectorType.RoadPoint, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedCurveRoadPointId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCurveRoadPointId,
|
|
|
- VectorType.CurveRoadPoint,
|
|
|
- SelectState.Select,
|
|
|
- this.modifyPoint.dir
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCurveRoadPointId, VectorType.CurveRoadPoint, SelectState.Select, this.modifyPoint.dir);
|
|
|
} else if (this.modifyPoint.linkedRoadId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedRoadId,
|
|
|
- VectorType.Road,
|
|
|
- SelectState.Select,
|
|
|
- this.modifyPoint.dir
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedRoadId, VectorType.Road, SelectState.Select, this.modifyPoint.dir);
|
|
|
} else if (this.modifyPoint.linkedCurveRoadId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCurveRoadId,
|
|
|
- VectorType.CurveRoad,
|
|
|
- SelectState.Select,
|
|
|
- this.modifyPoint.dir
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCurveRoadId, VectorType.CurveRoad, SelectState.Select, this.modifyPoint.dir);
|
|
|
} else if (this.modifyPoint.linkedCrossCrossPointId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCrossCrossPointId,
|
|
|
- VectorType.CrossPoint,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCrossCrossPointId, VectorType.CrossPoint, SelectState.Select);
|
|
|
} else if (this.modifyPoint.textId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.textId,
|
|
|
- VectorType.Text,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.textId, VectorType.Text, SelectState.Select);
|
|
|
} else if (this.modifyPoint.magnifierId) {
|
|
|
// if (this.modifyPoint.index == 0) {
|
|
|
//点击隐藏的放大镜不显示
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.magnifierId,
|
|
|
- VectorType.Magnifier,
|
|
|
- this.modifyPoint.index
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.magnifierId, VectorType.Magnifier, this.modifyPoint.index);
|
|
|
// } else {
|
|
|
stateService.setSelectState(this.modifyPoint.index);
|
|
|
// }
|
|
|
} else if (this.modifyPoint.svgId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.svgId,
|
|
|
- VectorType.SVG,
|
|
|
- this.modifyPoint.index
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.svgId, VectorType.SVG, this.modifyPoint.index);
|
|
|
} else if (this.modifyPoint.linkedEdgeId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedEdgeId,
|
|
|
- VectorType.RoadEdge,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedEdgeId, VectorType.RoadEdge, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedCurveEdgeId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCurveEdgeId,
|
|
|
- VectorType.CurveRoadEdge,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCurveEdgeId, VectorType.CurveRoadEdge, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedPointId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedPointId,
|
|
|
- VectorType.Point,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedPointId, VectorType.Point, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedCurvePointId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCurvePointId,
|
|
|
- VectorType.CurvePoint,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCurvePointId, VectorType.CurvePoint, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedLineId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedLineId,
|
|
|
- VectorType.Line,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedLineId, VectorType.Line, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedCurveLineId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCurveLineId,
|
|
|
- VectorType.CurveLine,
|
|
|
- SelectState.Select
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCurveLineId, VectorType.CurveLine, SelectState.Select);
|
|
|
} else if (this.modifyPoint.linkedCircleId) {
|
|
|
- stateService.setSelectItem(
|
|
|
- this.modifyPoint.linkedCircleId,
|
|
|
- VectorType.Circle,
|
|
|
- this.modifyPoint.index
|
|
|
- );
|
|
|
+ stateService.setSelectItem(this.modifyPoint.linkedCircleId, VectorType.Circle, this.modifyPoint.index);
|
|
|
} else {
|
|
|
stateService.clearSelectItem();
|
|
|
}
|
|
@@ -1491,10 +1281,7 @@ export default class ListenLayer {
|
|
|
|
|
|
//调整到与像素的长度一致
|
|
|
getDistance(start, end) {
|
|
|
- return (
|
|
|
- (mathUtil.getDistance(start, end) * coordinate.zoom) /
|
|
|
- coordinate.defaultZoom
|
|
|
- );
|
|
|
+ return (mathUtil.getDistance(start, end) * coordinate.zoom) / coordinate.defaultZoom;
|
|
|
}
|
|
|
|
|
|
clear() {
|