|
@@ -16,35 +16,64 @@ export default class ListenLayer {
|
|
this.modifyPoint = null;
|
|
this.modifyPoint = null;
|
|
}
|
|
}
|
|
|
|
|
|
- //开始监听,exceptPointId表示不考虑的点,exceptRoadIds表示不考虑的墙
|
|
|
|
- start(
|
|
|
|
- position,
|
|
|
|
- exceptPointId,
|
|
|
|
- exceptRoadIds,
|
|
|
|
- exceptCurvePointId,
|
|
|
|
- exceptCurveRoadId,
|
|
|
|
- exceptCrossControlPointId
|
|
|
|
- ) {
|
|
|
|
|
|
+ //开始监听,exceptVectorIds表示不考虑的元素
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param exceptVectorIds:{
|
|
|
|
+ exceptPointId,
|
|
|
|
+ exceptLineId,
|
|
|
|
+ exceptRoadPointId,
|
|
|
|
+ exceptRoadIds,
|
|
|
|
+ exceptCurveRoadPointId,
|
|
|
|
+ exceptCurveRoadId,
|
|
|
|
+ exceptCrossControlPointId
|
|
|
|
+ }
|
|
|
|
+ * @returns
|
|
|
|
+ */
|
|
|
|
+ start(position, exceptVectorIds) {
|
|
let flag = false;
|
|
let flag = false;
|
|
|
|
+ let selectInfo = {};
|
|
|
|
+ if (!exceptVectorIds) {
|
|
|
|
+ exceptVectorIds = {};
|
|
|
|
+ }
|
|
this.clear();
|
|
this.clear();
|
|
- let curveRoadEdgeInfo = this.isSelectCurveRoad(position, exceptCurveRoadId);
|
|
|
|
- let roadEdgeInfo = this.isSelectRoad(position, exceptRoadIds);
|
|
|
|
- let curvePointInfo = this.isSelectCurvePoint(position, exceptCurvePointId);
|
|
|
|
- let pointInfo = this.isSelectPoint(position, exceptPointId);
|
|
|
|
- //交叉口拐弯处的控制点
|
|
|
|
- let controlPointInfo = this.isSelectCrossControlPoint(
|
|
|
|
|
|
+ selectInfo.curveRoadEdgeInfo = this.isSelectCurveRoad(
|
|
|
|
+ position,
|
|
|
|
+ exceptVectorIds.exceptCurveRoadId
|
|
|
|
+ ); //包括edge
|
|
|
|
+ selectInfo.roadEdgeInfo = this.isSelectRoad(
|
|
|
|
+ position,
|
|
|
|
+ exceptVectorIds.exceptRoadIds
|
|
|
|
+ ); //包括edge
|
|
|
|
+ selectInfo.curveRoadPointInfo = this.isSelectCurveRoadPoint(
|
|
position,
|
|
position,
|
|
- exceptCrossControlPointId
|
|
|
|
|
|
+ exceptVectorIds.exceptCurveRoadPointId
|
|
);
|
|
);
|
|
-
|
|
|
|
- this.setModifyPoint(
|
|
|
|
|
|
+ selectInfo.roadPointInfo = this.isSelectRoadPoint(
|
|
|
|
+ position,
|
|
|
|
+ exceptVectorIds.exceptRoadPointId
|
|
|
|
+ );
|
|
|
|
+ selectInfo.pointInfo = this.isSelectPoint(
|
|
|
|
+ position,
|
|
|
|
+ exceptVectorIds.exceptPointId
|
|
|
|
+ );
|
|
|
|
+ selectInfo.lineInfo = this.isSelectLine(
|
|
|
|
+ position,
|
|
|
|
+ exceptVectorIds.exceptLineId
|
|
|
|
+ );
|
|
|
|
+ // selectInfo.curveLineInfo = this.isSelectCurveLine(
|
|
|
|
+ // position,
|
|
|
|
+ // exceptVectorIds.exceptCurveLineId
|
|
|
|
+ // );
|
|
|
|
+ selectInfo.curveLineInfo = {};
|
|
|
|
+ selectInfo.curvePointInfo = {};
|
|
|
|
+ //交叉口拐弯处的控制点
|
|
|
|
+ selectInfo.controlPointInfo = this.isSelectCrossControlPoint(
|
|
position,
|
|
position,
|
|
- pointInfo,
|
|
|
|
- curvePointInfo,
|
|
|
|
- roadEdgeInfo,
|
|
|
|
- curveRoadEdgeInfo,
|
|
|
|
- controlPointInfo
|
|
|
|
|
|
+ exceptVectorIds.exceptCrossControlPointId
|
|
);
|
|
);
|
|
|
|
+
|
|
|
|
+ this.setModifyPoint(position, selectInfo);
|
|
flag = this.updateSelectItem();
|
|
flag = this.updateSelectItem();
|
|
return flag;
|
|
return flag;
|
|
}
|
|
}
|
|
@@ -57,25 +86,25 @@ export default class ListenLayer {
|
|
};
|
|
};
|
|
|
|
|
|
let seqInfo = {};
|
|
let seqInfo = {};
|
|
- const points = dataService.getRoadPoints();
|
|
|
|
|
|
+ const points = dataService.getPoints();
|
|
for (const pointId in points) {
|
|
for (const pointId in points) {
|
|
if (pointId == exceptPointId) {
|
|
if (pointId == exceptPointId) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- const point = dataService.getRoadPoint(pointId);
|
|
|
|
|
|
+ const point = dataService.getPoint(pointId);
|
|
const distance = mathUtil.getDistance(position, point);
|
|
const distance = mathUtil.getDistance(position, point);
|
|
if (distance < Constant.minAdsorbPix) {
|
|
if (distance < Constant.minAdsorbPix) {
|
|
if (pointInfo.pointId == null) {
|
|
if (pointInfo.pointId == null) {
|
|
pointInfo = {
|
|
pointInfo = {
|
|
pointId: pointId,
|
|
pointId: pointId,
|
|
- type: VectorType.RoadPoint,
|
|
|
|
|
|
+ type: VectorType.Point,
|
|
distance: distance,
|
|
distance: distance,
|
|
};
|
|
};
|
|
- } else if (pointInfo.pointId != null) {
|
|
|
|
|
|
+ } else {
|
|
if (distance < pointInfo.distance) {
|
|
if (distance < pointInfo.distance) {
|
|
pointInfo = {
|
|
pointInfo = {
|
|
pointId: pointId,
|
|
pointId: pointId,
|
|
- type: VectorType.RoadPoint,
|
|
|
|
|
|
+ type: VectorType.Point,
|
|
distance: distance,
|
|
distance: distance,
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -92,21 +121,18 @@ export default class ListenLayer {
|
|
}
|
|
}
|
|
|
|
|
|
if (pointInfo.pointId) {
|
|
if (pointInfo.pointId) {
|
|
- const linkedPoint = dataService.getRoadPoint(pointInfo.pointId);
|
|
|
|
|
|
+ pointInfo.linkedPointId = pointInfo.pointId;
|
|
|
|
+ const linkedPoint = dataService.getPoint(pointInfo.pointId);
|
|
pointInfo.x = linkedPoint.x;
|
|
pointInfo.x = linkedPoint.x;
|
|
pointInfo.y = linkedPoint.y;
|
|
pointInfo.y = linkedPoint.y;
|
|
- }
|
|
|
|
- //因为这种纠正的权限最低
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
if (seqInfo.hasOwnProperty("linkedPointIdX")) {
|
|
if (seqInfo.hasOwnProperty("linkedPointIdX")) {
|
|
- pointInfo.linkedPointIdX = seqInfo.linkedPointIdX;
|
|
|
|
|
|
+ pointInfo.linkedPointIdX = seqInfo.linkedPointIdY;
|
|
pointInfo.x = seqInfo.x;
|
|
pointInfo.x = seqInfo.x;
|
|
- }
|
|
|
|
- if (seqInfo.hasOwnProperty("linkedPointIdY")) {
|
|
|
|
|
|
+ } else if (seqInfo.hasOwnProperty("linkedPointIdY")) {
|
|
pointInfo.linkedPointIdY = seqInfo.linkedPointIdY;
|
|
pointInfo.linkedPointIdY = seqInfo.linkedPointIdY;
|
|
pointInfo.y = seqInfo.y;
|
|
pointInfo.y = seqInfo.y;
|
|
}
|
|
}
|
|
-
|
|
|
|
if (pointInfo.hasOwnProperty("y") && !pointInfo.hasOwnProperty("x")) {
|
|
if (pointInfo.hasOwnProperty("y") && !pointInfo.hasOwnProperty("x")) {
|
|
pointInfo.x = position.x;
|
|
pointInfo.x = position.x;
|
|
}
|
|
}
|
|
@@ -114,83 +140,318 @@ export default class ListenLayer {
|
|
pointInfo.y = position.y;
|
|
pointInfo.y = position.y;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return pointInfo;
|
|
return pointInfo;
|
|
}
|
|
}
|
|
|
|
|
|
- isSelectCurvePoint(position, exceptCurvePointId) {
|
|
|
|
- let curvePointInfo = {
|
|
|
|
- curvePointId: null,
|
|
|
|
|
|
+ isSelectLine(position, exceptLineIds) {
|
|
|
|
+ let lineInfo = {
|
|
|
|
+ lineId: null,
|
|
|
|
+ type: null,
|
|
|
|
+ distance: null,
|
|
|
|
+ };
|
|
|
|
+ const lines = dataService.getLines();
|
|
|
|
+ for (const lineId in lines) {
|
|
|
|
+ if (exceptLineId != null && exceptLineIds.hasOwnProperty(lineId)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ const line = dataService.getLine(lineId);
|
|
|
|
+ let startPoint = dataService.getPoint(line.startId);
|
|
|
|
+ let endPoint = dataService.getPoint(line.endId);
|
|
|
|
+ const comLine = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
+ const join = mathUtil.getJoinLinePoint(position, comLine);
|
|
|
|
+ const distance = mathUtil.getDistance(position, join);
|
|
|
|
+ if (!mathUtil.isContainForSegment(join, startPoint, endPoint)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (distance < Constant.minAdsorbPix / 2) {
|
|
|
|
+ lineInfo = {
|
|
|
|
+ lineId: lineId,
|
|
|
|
+ type: VectorType.Line,
|
|
|
|
+ distance: distance,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (lineInfo.lineId) {
|
|
|
|
+ const linkedLine = dataService.getLine(lineInfo.lineId);
|
|
|
|
+ let startPoint = dataService.getPoint(linkedLine.startId);
|
|
|
|
+ let endPoint = dataService.getPoint(linkedLine.endId);
|
|
|
|
+ const linkedComLine = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
+ const linkedPosition = mathUtil.getJoinLinePoint(position, linkedComLine);
|
|
|
|
+ lineInfo.x = linkedPosition.x;
|
|
|
|
+ lineInfo.y = linkedPosition.y;
|
|
|
|
+ return lineInfo;
|
|
|
|
+ }
|
|
|
|
+ return lineInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // isSelectCurveLine(position, exceptCurveLineId) {
|
|
|
|
+ // let curveLineInfo = {
|
|
|
|
+ // curveLineId: null,
|
|
|
|
+ // type: null,
|
|
|
|
+ // distance: null,
|
|
|
|
+ // };
|
|
|
|
+ // let seqInfo = {};
|
|
|
|
+ // const curveLines = dataService.getCurveLines();
|
|
|
|
+
|
|
|
|
+ // for (const curveLineId in curveLines) {
|
|
|
|
+ // if (curveLineId == exceptCurveLineId) {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // const curveLine = dataService.getCurveLine(curveLineId);
|
|
|
|
+ // let joinInfo = this.distanceForBezier(
|
|
|
|
+ // position,
|
|
|
|
+ // curveRoad.curves,
|
|
|
|
+ // Constant.minAdsorbPix / 2
|
|
|
|
+ // );
|
|
|
|
+
|
|
|
|
+ // if (
|
|
|
|
+ // mathUtil.isClockwise([curveRoad.points[0], joinInfo.position, position])
|
|
|
|
+ // ) {
|
|
|
|
+ // //选中了路
|
|
|
|
+ // if (joinInfo.distance < curveRoad.leftWidth - Constant.minAdsorbPix) {
|
|
|
|
+ // curveRoadInfo = {
|
|
|
|
+ // curveRoadId: curveRoadId,
|
|
|
|
+ // type: VectorType.CurveRoad,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // //选中了edge
|
|
|
|
+ // else if (
|
|
|
|
+ // joinInfo.distance <
|
|
|
|
+ // curveRoad.leftWidth + Constant.minAdsorbPix
|
|
|
|
+ // ) {
|
|
|
|
+ // const leftCurveEdge = dataService.getCurveRoadEdge(
|
|
|
|
+ // curveRoad.leftEdgeId
|
|
|
|
+ // );
|
|
|
|
+ // joinInfo = this.distanceForBezier(
|
|
|
|
+ // position,
|
|
|
|
+ // leftCurveEdge.curves,
|
|
|
|
+ // curveRoad.leftWidth
|
|
|
|
+ // );
|
|
|
|
+ // const index = mathUtil.getIndexForCurvesPoints(
|
|
|
|
+ // joinInfo.position,
|
|
|
|
+ // curveRoad.points
|
|
|
|
+ // );
|
|
|
|
+ // curveEdgeInfo = {
|
|
|
|
+ // curveEdgeId: curveRoad.leftEdgeId,
|
|
|
|
+ // type: VectorType.CurveRoadEdge,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // selectIndex: index,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // } else if (
|
|
|
|
+ // !mathUtil.isClockwise([
|
|
|
|
+ // curveRoad.points[0],
|
|
|
|
+ // joinInfo.position,
|
|
|
|
+ // position,
|
|
|
|
+ // ])
|
|
|
|
+ // ) {
|
|
|
|
+ // //选中了路
|
|
|
|
+ // if (joinInfo.distance < curveRoad.rightWidth - Constant.minAdsorbPix) {
|
|
|
|
+ // curveRoadInfo = {
|
|
|
|
+ // curveRoadId: curveRoadId,
|
|
|
|
+ // type: VectorType.CurveRoad,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // //选中了edge
|
|
|
|
+ // else if (
|
|
|
|
+ // joinInfo.distance <
|
|
|
|
+ // curveRoad.rightWidth + Constant.minAdsorbPix
|
|
|
|
+ // ) {
|
|
|
|
+ // const rightCurveEdge = dataService.getCurveRoadEdge(
|
|
|
|
+ // curveRoad.rightEdgeId
|
|
|
|
+ // );
|
|
|
|
+ // joinInfo = this.distanceForBezier(
|
|
|
|
+ // position,
|
|
|
|
+ // rightCurveEdge.curves,
|
|
|
|
+ // curveRoad.rightWidth
|
|
|
|
+ // );
|
|
|
|
+ // const index = mathUtil.getIndexForCurvesPoints(
|
|
|
|
+ // joinInfo.position,
|
|
|
|
+ // curveRoad.points
|
|
|
|
+ // );
|
|
|
|
+ // curveEdgeInfo = {
|
|
|
|
+ // curveEdgeId: curveRoad.rightEdgeId,
|
|
|
|
+ // type: VectorType.CurveRoadEdge,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // selectIndex: index,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // if (curveRoadInfo.curveRoadId) {
|
|
|
|
+ // return curveRoadInfo;
|
|
|
|
+ // } else if (curveEdgeInfo.curveEdgeId) {
|
|
|
|
+ // return curveEdgeInfo;
|
|
|
|
+ // } else {
|
|
|
|
+ // return {
|
|
|
|
+ // curveRoadId: null,
|
|
|
|
+ // curveEdgeId: null,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ isSelectRoadPoint(position, exceptRoadPointId) {
|
|
|
|
+ let roadPointInfo = {
|
|
|
|
+ roadPointId: null,
|
|
type: null,
|
|
type: null,
|
|
distance: null,
|
|
distance: null,
|
|
};
|
|
};
|
|
|
|
|
|
let seqInfo = {};
|
|
let seqInfo = {};
|
|
- const curvePoints = dataService.getCurvePoints();
|
|
|
|
- for (const curvePointId in curvePoints) {
|
|
|
|
- if (curvePointId == exceptCurvePointId) {
|
|
|
|
|
|
+ const roadPoints = dataService.getRoadPoints();
|
|
|
|
+ for (const roadPointId in roadPoints) {
|
|
|
|
+ if (roadPointId == exceptRoadPointId) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- const curvePoint = dataService.getCurvePoint(curvePointId);
|
|
|
|
- const distance = mathUtil.getDistance(position, curvePoint);
|
|
|
|
|
|
+ const roadPoint = dataService.getRoadPoint(roadPointId);
|
|
|
|
+ const distance = mathUtil.getDistance(position, roadPoint);
|
|
if (distance < Constant.minAdsorbPix) {
|
|
if (distance < Constant.minAdsorbPix) {
|
|
- if (curvePointInfo.curvePointId == null) {
|
|
|
|
- curvePointInfo = {
|
|
|
|
- curvePointId: curvePointId,
|
|
|
|
- type: VectorType.CurvePoint,
|
|
|
|
|
|
+ if (roadPointInfo.roadPointId == null) {
|
|
|
|
+ roadPointInfo = {
|
|
|
|
+ roadPointId: roadPointId,
|
|
|
|
+ type: VectorType.RoadPoint,
|
|
distance: distance,
|
|
distance: distance,
|
|
};
|
|
};
|
|
- } else if (curvePointInfo.pointId != null) {
|
|
|
|
- if (distance < curvePointInfo.distance) {
|
|
|
|
- curvePointInfo = {
|
|
|
|
- curvePointId: curvePointId,
|
|
|
|
- type: VectorType.CurvePoint,
|
|
|
|
|
|
+ } else if (roadPointInfo.roadPointId != null) {
|
|
|
|
+ if (distance < roadPointInfo.distance) {
|
|
|
|
+ roadPointInfo = {
|
|
|
|
+ roadPointId: roadPointId,
|
|
|
|
+ type: VectorType.RoadPoint,
|
|
distance: distance,
|
|
distance: distance,
|
|
};
|
|
};
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (Math.abs(position.x - curvePoint.x) < Constant.minAdsorbPix) {
|
|
|
|
- seqInfo.linkedPointIdX = curvePointId;
|
|
|
|
- seqInfo.x = curvePoint.x;
|
|
|
|
|
|
+ if (Math.abs(position.x - roadPoint.x) < Constant.minAdsorbPix) {
|
|
|
|
+ seqInfo.linkedRoadPointIdX = roadPointId;
|
|
|
|
+ seqInfo.x = roadPoint.x;
|
|
|
|
+ } else if (Math.abs(position.y - roadPoint.y) < Constant.minAdsorbPix) {
|
|
|
|
+ seqInfo.linkedRoadPointIdY = roadPointId;
|
|
|
|
+ seqInfo.y = roadPoint.y;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (roadPointInfo.roadPointId) {
|
|
|
|
+ const linkedPoint = dataService.getRoadPoint(roadPointInfo.roadPointId);
|
|
|
|
+ roadPointInfo.x = linkedPoint.x;
|
|
|
|
+ roadPointInfo.y = linkedPoint.y;
|
|
|
|
+ }
|
|
|
|
+ //因为这种纠正的权限最低
|
|
|
|
+ else {
|
|
|
|
+ if (seqInfo.hasOwnProperty("linkedRoadPointIdX")) {
|
|
|
|
+ roadPointInfo.linkedRoadPointIdX = seqInfo.linkedRoadPointIdX;
|
|
|
|
+ roadPointInfo.x = seqInfo.x;
|
|
|
|
+ }
|
|
|
|
+ if (seqInfo.hasOwnProperty("linkedRoadPointIdY")) {
|
|
|
|
+ roadPointInfo.linkedRoadPointIdY = seqInfo.linkedRoadPointIdY;
|
|
|
|
+ roadPointInfo.y = seqInfo.y;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (
|
|
|
|
+ roadPointInfo.hasOwnProperty("y") &&
|
|
|
|
+ !roadPointInfo.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
|
|
+ roadPointInfo.x = position.x;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ roadPointInfo.hasOwnProperty("x") &&
|
|
|
|
+ !roadPointInfo.hasOwnProperty("y")
|
|
|
|
+ ) {
|
|
|
|
+ roadPointInfo.y = position.y;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return roadPointInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ isSelectCurveRoadPoint(position, exceptCurveRoadPointId) {
|
|
|
|
+ let curveRoadPointInfo = {
|
|
|
|
+ curveRoadPointId: null,
|
|
|
|
+ type: null,
|
|
|
|
+ distance: null,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let seqInfo = {};
|
|
|
|
+ const curveRoadPoints = dataService.getCurveRoadPoints();
|
|
|
|
+ for (const curveRoadPointId in curveRoadPoints) {
|
|
|
|
+ if (curveRoadPointId == exceptCurveRoadPointId) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ const curveRoadPoint = dataService.getCurveRoadPoint(curveRoadPointId);
|
|
|
|
+ const distance = mathUtil.getDistance(position, curveRoadPoint);
|
|
|
|
+ if (distance < Constant.minAdsorbPix) {
|
|
|
|
+ if (curveRoadPointInfo.curveRoadPointId == null) {
|
|
|
|
+ curveRoadPointInfo = {
|
|
|
|
+ curveRoadPointId: curveRoadPointId,
|
|
|
|
+ type: VectorType.CurveRoadPoint,
|
|
|
|
+ distance: distance,
|
|
|
|
+ };
|
|
|
|
+ } else {
|
|
|
|
+ if (distance < curveRoadPointInfo.distance) {
|
|
|
|
+ curveRoadPointInfo = {
|
|
|
|
+ curveRoadPointId: curveRoadPointId,
|
|
|
|
+ type: VectorType.CurveRoadPoint,
|
|
|
|
+ distance: distance,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (Math.abs(position.x - curveRoadPoint.x) < Constant.minAdsorbPix) {
|
|
|
|
+ seqInfo.linkedCurveRoadPointIdX = curveRoadPointId;
|
|
|
|
+ seqInfo.x = curveRoadPoint.x;
|
|
} else if (
|
|
} else if (
|
|
- Math.abs(position.y - curvePoint.y) < Constant.minAdsorbPix
|
|
|
|
|
|
+ Math.abs(position.y - curveRoadPoint.y) < Constant.minAdsorbPix
|
|
) {
|
|
) {
|
|
- seqInfo.linkedPointIdY = curvePointId;
|
|
|
|
- seqInfo.y = curvePoint.y;
|
|
|
|
|
|
+ seqInfo.linkedCurveRoadPointIdY = curveRoadPointId;
|
|
|
|
+ seqInfo.y = curveRoadPoint.y;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (curvePointInfo.curvePointId) {
|
|
|
|
- curvePointInfo.linkedCurvePointId = curvePointInfo.curvePointId;
|
|
|
|
- const linkedCurvePoint = dataService.getCurvePoint(
|
|
|
|
- curvePointInfo.curvePointId
|
|
|
|
|
|
+ if (curveRoadPointInfo.curveRoadPointId) {
|
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointId =
|
|
|
|
+ curveRoadPointInfo.curveRoadPointId;
|
|
|
|
+ const linkedCurvePoint = dataService.getCurveRoadPoint(
|
|
|
|
+ curveRoadPointInfo.curveRoadPointId
|
|
);
|
|
);
|
|
- curvePointInfo.x = linkedCurvePoint.x;
|
|
|
|
- curvePointInfo.y = linkedCurvePoint.y;
|
|
|
|
|
|
+ curveRoadPointInfo.x = linkedCurvePoint.x;
|
|
|
|
+ curveRoadPointInfo.y = linkedCurvePoint.y;
|
|
} else {
|
|
} else {
|
|
- if (seqInfo.hasOwnProperty("linkedPointIdX")) {
|
|
|
|
- curvePointInfo.linkedPointIdX = seqInfo.linkedPointIdX;
|
|
|
|
- curvePointInfo.x = seqInfo.x;
|
|
|
|
- } else if (seqInfo.hasOwnProperty("linkedPointIdY")) {
|
|
|
|
- curvePointInfo.linkedPointIdY = seqInfo.linkedPointIdY;
|
|
|
|
- curvePointInfo.y = seqInfo.y;
|
|
|
|
|
|
+ if (seqInfo.hasOwnProperty("linkedCurveRoadPointIdX")) {
|
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointIdX =
|
|
|
|
+ seqInfo.linkedCurveRoadPointIdX;
|
|
|
|
+ curveRoadPointInfo.x = seqInfo.x;
|
|
|
|
+ } else if (seqInfo.hasOwnProperty("linkedCurveRoadPointIdY")) {
|
|
|
|
+ curveRoadPointInfo.linkedCurveRoadPointIdY =
|
|
|
|
+ seqInfo.linkedCurveRoadPointIdY;
|
|
|
|
+ curveRoadPointInfo.y = seqInfo.y;
|
|
}
|
|
}
|
|
if (
|
|
if (
|
|
- curvePointInfo.hasOwnProperty("y") &&
|
|
|
|
- !curvePointInfo.hasOwnProperty("x")
|
|
|
|
|
|
+ curveRoadPointInfo.hasOwnProperty("y") &&
|
|
|
|
+ !curveRoadPointInfo.hasOwnProperty("x")
|
|
) {
|
|
) {
|
|
- curvePointInfo.x = position.x;
|
|
|
|
|
|
+ curveRoadPointInfo.x = position.x;
|
|
}
|
|
}
|
|
if (
|
|
if (
|
|
- curvePointInfo.hasOwnProperty("x") &&
|
|
|
|
- !curvePointInfo.hasOwnProperty("y")
|
|
|
|
|
|
+ curveRoadPointInfo.hasOwnProperty("x") &&
|
|
|
|
+ !curveRoadPointInfo.hasOwnProperty("y")
|
|
) {
|
|
) {
|
|
- curvePointInfo.y = position.y;
|
|
|
|
|
|
+ curveRoadPointInfo.y = position.y;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return curvePointInfo;
|
|
|
|
|
|
+ return curveRoadPointInfo;
|
|
}
|
|
}
|
|
|
|
|
|
isSelectRoad(position, exceptRoadIds) {
|
|
isSelectRoad(position, exceptRoadIds) {
|
|
@@ -237,7 +498,7 @@ export default class ListenLayer {
|
|
} else if (distance < road.leftWidth + Constant.minAdsorbPix) {
|
|
} else if (distance < road.leftWidth + Constant.minAdsorbPix) {
|
|
edgeInfo = {
|
|
edgeInfo = {
|
|
edgeId: road.leftEdgeId,
|
|
edgeId: road.leftEdgeId,
|
|
- type: VectorType.Edge,
|
|
|
|
|
|
+ type: VectorType.RoadEdge,
|
|
distance: distance,
|
|
distance: distance,
|
|
dir: "left",
|
|
dir: "left",
|
|
};
|
|
};
|
|
@@ -254,7 +515,7 @@ export default class ListenLayer {
|
|
} else if (distance < road.rightWidth + Constant.minAdsorbPix) {
|
|
} else if (distance < road.rightWidth + Constant.minAdsorbPix) {
|
|
edgeInfo = {
|
|
edgeInfo = {
|
|
edgeId: road.rightEdgeId,
|
|
edgeId: road.rightEdgeId,
|
|
- type: VectorType.Edge,
|
|
|
|
|
|
+ type: VectorType.RoadEdge,
|
|
distance: distance,
|
|
distance: distance,
|
|
dir: "right",
|
|
dir: "right",
|
|
};
|
|
};
|
|
@@ -274,13 +535,13 @@ export default class ListenLayer {
|
|
return roadInfo;
|
|
return roadInfo;
|
|
} else if (edgeInfo.edgeId) {
|
|
} else if (edgeInfo.edgeId) {
|
|
if (edgeInfo.dir == "left") {
|
|
if (edgeInfo.dir == "left") {
|
|
- const leftEdge = dataService.getEdge(edgeInfo.edgeId);
|
|
|
|
|
|
+ const leftEdge = dataService.getRoadEdge(edgeInfo.edgeId);
|
|
const leftLine = edgeService.getLine(leftEdge);
|
|
const leftLine = edgeService.getLine(leftEdge);
|
|
const linkedPosition = mathUtil.getJoinLinePoint(position, leftLine);
|
|
const linkedPosition = mathUtil.getJoinLinePoint(position, leftLine);
|
|
edgeInfo.x = linkedPosition.x;
|
|
edgeInfo.x = linkedPosition.x;
|
|
edgeInfo.y = linkedPosition.y;
|
|
edgeInfo.y = linkedPosition.y;
|
|
} else {
|
|
} else {
|
|
- const rightEdge = dataService.getEdge(edgeInfo.edgeId);
|
|
|
|
|
|
+ const rightEdge = dataService.getRoadEdge(edgeInfo.edgeId);
|
|
const rightLine = edgeService.getLine(rightEdge);
|
|
const rightLine = edgeService.getLine(rightEdge);
|
|
const linkedPosition = mathUtil.getJoinLinePoint(position, rightLine);
|
|
const linkedPosition = mathUtil.getJoinLinePoint(position, rightLine);
|
|
edgeInfo.x = linkedPosition.x;
|
|
edgeInfo.x = linkedPosition.x;
|
|
@@ -336,7 +597,9 @@ export default class ListenLayer {
|
|
joinInfo.distance <
|
|
joinInfo.distance <
|
|
curveRoad.leftWidth + Constant.minAdsorbPix
|
|
curveRoad.leftWidth + Constant.minAdsorbPix
|
|
) {
|
|
) {
|
|
- const leftCurveEdge = dataService.getCurveEdge(curveRoad.leftEdgeId);
|
|
|
|
|
|
+ const leftCurveEdge = dataService.getCurveRoadEdge(
|
|
|
|
+ curveRoad.leftEdgeId
|
|
|
|
+ );
|
|
joinInfo = this.distanceForBezier(
|
|
joinInfo = this.distanceForBezier(
|
|
position,
|
|
position,
|
|
leftCurveEdge.curves,
|
|
leftCurveEdge.curves,
|
|
@@ -348,7 +611,7 @@ export default class ListenLayer {
|
|
);
|
|
);
|
|
curveEdgeInfo = {
|
|
curveEdgeInfo = {
|
|
curveEdgeId: curveRoad.leftEdgeId,
|
|
curveEdgeId: curveRoad.leftEdgeId,
|
|
- type: VectorType.CurveEdge,
|
|
|
|
|
|
+ type: VectorType.CurveRoadEdge,
|
|
distance: joinInfo.distance,
|
|
distance: joinInfo.distance,
|
|
selectIndex: index,
|
|
selectIndex: index,
|
|
x: joinInfo.position.x,
|
|
x: joinInfo.position.x,
|
|
@@ -377,7 +640,7 @@ export default class ListenLayer {
|
|
joinInfo.distance <
|
|
joinInfo.distance <
|
|
curveRoad.rightWidth + Constant.minAdsorbPix
|
|
curveRoad.rightWidth + Constant.minAdsorbPix
|
|
) {
|
|
) {
|
|
- const rightCurveEdge = dataService.getCurveEdge(
|
|
|
|
|
|
+ const rightCurveEdge = dataService.getCurveRoadEdge(
|
|
curveRoad.rightEdgeId
|
|
curveRoad.rightEdgeId
|
|
);
|
|
);
|
|
joinInfo = this.distanceForBezier(
|
|
joinInfo = this.distanceForBezier(
|
|
@@ -391,7 +654,7 @@ export default class ListenLayer {
|
|
);
|
|
);
|
|
curveEdgeInfo = {
|
|
curveEdgeInfo = {
|
|
curveEdgeId: curveRoad.rightEdgeId,
|
|
curveEdgeId: curveRoad.rightEdgeId,
|
|
- type: VectorType.CurveEdge,
|
|
|
|
|
|
+ type: VectorType.CurveRoadEdge,
|
|
distance: joinInfo.distance,
|
|
distance: joinInfo.distance,
|
|
selectIndex: index,
|
|
selectIndex: index,
|
|
x: joinInfo.position.x,
|
|
x: joinInfo.position.x,
|
|
@@ -439,105 +702,177 @@ export default class ListenLayer {
|
|
return crossControlPointInfo;
|
|
return crossControlPointInfo;
|
|
}
|
|
}
|
|
|
|
|
|
- setModifyPoint(
|
|
|
|
- position,
|
|
|
|
- pointInfo,
|
|
|
|
- curvePointInfo,
|
|
|
|
- roadEdgeInfo,
|
|
|
|
- curveRoadEdgeInfo,
|
|
|
|
- controlPointInfo
|
|
|
|
- ) {
|
|
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param info:{
|
|
|
|
+ roadPointInfo,
|
|
|
|
+ curveRoadPointInfo,
|
|
|
|
+ roadEdgeInfo,
|
|
|
|
+ curveRoadEdgeInfo,
|
|
|
|
+ controlPointInfo,
|
|
|
|
+ pointInfo,
|
|
|
|
+ roadPointInfo
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ setModifyPoint(position, info) {
|
|
//优先级最高
|
|
//优先级最高
|
|
- if (pointInfo.pointId || curvePointInfo.curvePointId) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ info &&
|
|
|
|
+ (info.roadPointInfo.roadPointId ||
|
|
|
|
+ info.curveRoadPointInfo.curveRoadPointId)
|
|
|
|
+ ) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- if (pointInfo.pointId && curvePointInfo.curvePointId) {
|
|
|
|
- if (pointInfo.distance < curvePointInfo.distance) {
|
|
|
|
- this.modifyPoint.linkedPointId = pointInfo.pointId;
|
|
|
|
- this.modifyPoint.x = pointInfo.x;
|
|
|
|
- this.modifyPoint.y = pointInfo.y;
|
|
|
|
|
|
+ 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 {
|
|
} else {
|
|
- this.modifyPoint.linkedCurvePointId = curvePointInfo.curvePointId;
|
|
|
|
- this.modifyPoint.x = curvePointInfo.x;
|
|
|
|
- this.modifyPoint.y = curvePointInfo.y;
|
|
|
|
|
|
+ this.modifyPoint.linkedCurveRoadPointId =
|
|
|
|
+ info.curveRoadPointInfo.curveRoadPointId;
|
|
|
|
+ this.modifyPoint.x = info.curveRoadPointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveRoadPointInfo.y;
|
|
}
|
|
}
|
|
- } else if (pointInfo.pointId) {
|
|
|
|
- this.modifyPoint.linkedPointId = pointInfo.pointId;
|
|
|
|
- this.modifyPoint.x = pointInfo.x;
|
|
|
|
- this.modifyPoint.y = pointInfo.y;
|
|
|
|
- } else if (curvePointInfo.curvePointId) {
|
|
|
|
- this.modifyPoint.linkedCurvePointId = curvePointInfo.curvePointId;
|
|
|
|
- this.modifyPoint.x = curvePointInfo.x;
|
|
|
|
- this.modifyPoint.y = curvePointInfo.y;
|
|
|
|
- }
|
|
|
|
- } else if (roadEdgeInfo.roadId || curveRoadEdgeInfo.curveRoadId) {
|
|
|
|
|
|
+ } else if (info.roadPointInfo.roadPointId) {
|
|
|
|
+ this.modifyPoint.linkedRoadPointId = info.roadPointInfo.roadPointId;
|
|
|
|
+ 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.x = info.curveRoadPointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveRoadPointInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } 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) {
|
|
|
|
+ this.modifyPoint.linkedPointId = info.pointInfo.pointId;
|
|
|
|
+ this.modifyPoint.x = info.pointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.pointInfo.y;
|
|
|
|
+ } else {
|
|
|
|
+ this.modifyPoint.linkedCurvePointId =
|
|
|
|
+ info.curvePointInfo.curvePointId;
|
|
|
|
+ this.modifyPoint.x = info.curvePointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curvePointInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } else if (info.pointInfo.pointId) {
|
|
|
|
+ this.modifyPoint.linkedPointId = info.pointInfo.pointId;
|
|
|
|
+ this.modifyPoint.x = info.pointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.pointInfo.y;
|
|
|
|
+ } else if (info.curvePointInfo.curvePointId) {
|
|
|
|
+ this.modifyPoint.linkedCurvePointId = info.curvePointInfo.curvePointId;
|
|
|
|
+ this.modifyPoint.x = info.curvePointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curvePointInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } else if (
|
|
|
|
+ info &&
|
|
|
|
+ (info.roadEdgeInfo.roadId || info.curveRoadEdgeInfo.curveRoadId)
|
|
|
|
+ ) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- if (roadEdgeInfo.roadId && curveRoadEdgeInfo.curveRoadId) {
|
|
|
|
- if (roadEdgeInfo.distance < curveRoadEdgeInfo.distance) {
|
|
|
|
- this.modifyPoint.linkedRoadId = roadEdgeInfo.roadId;
|
|
|
|
- this.modifyPoint.x = roadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = roadEdgeInfo.y;
|
|
|
|
|
|
+ if (info.roadEdgeInfo.roadId && info.curveRoadEdgeInfo.curveRoadId) {
|
|
|
|
+ if (roadEdgeInfo.distance < info.curveRoadEdgeInfo.distance) {
|
|
|
|
+ this.modifyPoint.linkedRoadId = info.roadEdgeInfo.roadId;
|
|
|
|
+ this.modifyPoint.x = info.roadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.roadEdgeInfo.y;
|
|
} else {
|
|
} else {
|
|
this.modifyPoint.linkedCurveRoadId = curveRoadEdgeInfo.curveRoadId;
|
|
this.modifyPoint.linkedCurveRoadId = curveRoadEdgeInfo.curveRoadId;
|
|
- this.modifyPoint.x = curveRoadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = curveRoadEdgeInfo.y;
|
|
|
|
|
|
+ this.modifyPoint.x = info.curveRoadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveRoadEdgeInfo.y;
|
|
}
|
|
}
|
|
- } else if (roadEdgeInfo.roadId) {
|
|
|
|
- this.modifyPoint.linkedRoadId = roadEdgeInfo.roadId;
|
|
|
|
- this.modifyPoint.x = roadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = roadEdgeInfo.y;
|
|
|
|
- } else if (curveRoadEdgeInfo.curveRoadId) {
|
|
|
|
- this.modifyPoint.linkedCurveRoadId = curveRoadEdgeInfo.curveRoadId;
|
|
|
|
- this.modifyPoint.x = curveRoadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = curveRoadEdgeInfo.y;
|
|
|
|
- }
|
|
|
|
- } else if (controlPointInfo.crossControlPointId) {
|
|
|
|
|
|
+ } else if (info.roadEdgeInfo.roadId) {
|
|
|
|
+ this.modifyPoint.linkedRoadId = info.roadEdgeInfo.roadId;
|
|
|
|
+ this.modifyPoint.x = info.roadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.roadEdgeInfo.y;
|
|
|
|
+ } else if (info.curveRoadEdgeInfo.curveRoadId) {
|
|
|
|
+ this.modifyPoint.linkedCurveRoadId = info.curveRoadEdgeInfo.curveRoadId;
|
|
|
|
+ this.modifyPoint.x = info.curveRoadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveRoadEdgeInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } else if (info && info.controlPointInfo.crossControlPointId) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
this.modifyPoint.linkedCrossControlPointId =
|
|
this.modifyPoint.linkedCrossControlPointId =
|
|
- controlPointInfo.crossControlPointId;
|
|
|
|
- this.modifyPoint.x = controlPointInfo.x;
|
|
|
|
- this.modifyPoint.y = controlPointInfo.y;
|
|
|
|
- } else if (roadEdgeInfo.edgeId || curveRoadEdgeInfo.curveEdgeId) {
|
|
|
|
|
|
+ info.controlPointInfo.crossControlPointId;
|
|
|
|
+ this.modifyPoint.x = info.controlPointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.controlPointInfo.y;
|
|
|
|
+ } else if (
|
|
|
|
+ info &&
|
|
|
|
+ (info.roadEdgeInfo.edgeId || info.curveRoadEdgeInfo.curveEdgeId)
|
|
|
|
+ ) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- if (roadEdgeInfo.edgeId && curveRoadEdgeInfo.curveEdgeId) {
|
|
|
|
- if (roadEdgeInfo.distance < curveRoadEdgeInfo.distance) {
|
|
|
|
- this.modifyPoint.linkedEdgeId = roadEdgeInfo.edgeId;
|
|
|
|
- this.modifyPoint.x = roadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = roadEdgeInfo.y;
|
|
|
|
|
|
+ if (info.roadEdgeInfo.edgeId && info.curveRoadEdgeInfo.curveEdgeId) {
|
|
|
|
+ if (info.roadEdgeInfo.distance < info.curveRoadEdgeInfo.distance) {
|
|
|
|
+ this.modifyPoint.linkedEdgeId = info.roadEdgeInfo.edgeId;
|
|
|
|
+ this.modifyPoint.x = info.roadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.roadEdgeInfo.y;
|
|
} else {
|
|
} else {
|
|
- this.modifyPoint.linkedCurveEdgeId = curveRoadEdgeInfo.curveEdgeId;
|
|
|
|
- this.modifyPoint.selectIndex = curveRoadEdgeInfo.selectIndex;
|
|
|
|
- this.modifyPoint.x = curveRoadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = curveRoadEdgeInfo.y;
|
|
|
|
|
|
+ this.modifyPoint.linkedCurveEdgeId =
|
|
|
|
+ info.curveRoadEdgeInfo.curveEdgeId;
|
|
|
|
+ this.modifyPoint.selectIndex = info.curveRoadEdgeInfo.selectIndex;
|
|
|
|
+ this.modifyPoint.x = info.curveRoadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveRoadEdgeInfo.y;
|
|
}
|
|
}
|
|
- } else if (roadEdgeInfo.edgeId) {
|
|
|
|
- this.modifyPoint.linkedEdgeId = roadEdgeInfo.edgeId;
|
|
|
|
- this.modifyPoint.x = roadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = roadEdgeInfo.y;
|
|
|
|
- } else if (curveRoadEdgeInfo.curveEdgeId) {
|
|
|
|
- this.modifyPoint.linkedCurveEdgeId = curveRoadEdgeInfo.curveEdgeId;
|
|
|
|
- this.modifyPoint.selectIndex = curveRoadEdgeInfo.selectIndex;
|
|
|
|
- this.modifyPoint.x = curveRoadEdgeInfo.x;
|
|
|
|
- this.modifyPoint.y = curveRoadEdgeInfo.y;
|
|
|
|
- }
|
|
|
|
- } else if (pointInfo.linkedPointIdX) {
|
|
|
|
|
|
+ } else if (info.roadEdgeInfo.edgeId) {
|
|
|
|
+ this.modifyPoint.linkedEdgeId = info.roadEdgeInfo.edgeId;
|
|
|
|
+ this.modifyPoint.x = info.roadEdgeInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.roadEdgeInfo.y;
|
|
|
|
+ } else if (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;
|
|
|
|
+ }
|
|
|
|
+ } else if (
|
|
|
|
+ info &&
|
|
|
|
+ (info.lineInfo.lineId || info.curveLineInfo.curveLineId)
|
|
|
|
+ ) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- this.modifyPoint.linkedPointIdX = pointInfo.linkedPointIdX;
|
|
|
|
- this.modifyPoint.x = pointInfo.x;
|
|
|
|
- this.modifyPoint.y = position.y;
|
|
|
|
- } else if (pointInfo.linkedPointIdY) {
|
|
|
|
|
|
+ if (info.lineInfo.lineId && info.curveLineInfo.curveLineId) {
|
|
|
|
+ if (info.lineInfo.distance < info.curveLineInfo.distance) {
|
|
|
|
+ this.modifyPoint.linkedLineId = info.lineInfo.lineId;
|
|
|
|
+ this.modifyPoint.x = info.lineInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.lineInfo.y;
|
|
|
|
+ } else {
|
|
|
|
+ this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
|
|
|
|
+ this.modifyPoint.x = info.curveLineInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveLineInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } else if (info.lineInfo.lineId) {
|
|
|
|
+ this.modifyPoint.linkedLineId = info.lineInfo.lineId;
|
|
|
|
+ this.modifyPoint.x = info.lineInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.lineInfo.y;
|
|
|
|
+ } else if (info.curveLineInfo.curveLineId) {
|
|
|
|
+ this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
|
|
|
|
+ this.modifyPoint.x = info.curveLineInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.curveLineInfo.y;
|
|
|
|
+ }
|
|
|
|
+ } else if (info && info.pointInfo.linkedRoadPointIdX) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- this.modifyPoint.linkedPointIdY = pointInfo.linkedPointIdY;
|
|
|
|
- this.modifyPoint.y = pointInfo.y;
|
|
|
|
- this.modifyPoint.x = position.x;
|
|
|
|
- } else if (curvePointInfo.linkedPointIdX) {
|
|
|
|
|
|
+ this.modifyPoint.linkedPointIdX = info.pointInfo.linkedRoadPointIdX;
|
|
|
|
+ this.modifyPoint.x = info.pointInfo.x;
|
|
|
|
+ this.modifyPoint.y = info.pointInfo.y;
|
|
|
|
+ } else if (info && info.pointInfo.linkedRoadPointIdY) {
|
|
|
|
+ this.modifyPoint = {};
|
|
|
|
+ this.modifyPoint.linkedPointIdY = info.pointInfo.linkedRoadPointIdY;
|
|
|
|
+ this.modifyPoint.y = info.pointInfo.y;
|
|
|
|
+ this.modifyPoint.x = info.pointInfo.x;
|
|
|
|
+ } else if (info && info.curvePointInfo.linkedRoadPointIdX) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- this.modifyPoint.linkedPointIdX = curvePointInfo.linkedPointIdX;
|
|
|
|
- this.modifyPoint.x = curvePointInfo.x;
|
|
|
|
|
|
+ this.modifyPoint.linkedRoadPointIdX =
|
|
|
|
+ info.curvePointInfo.linkedRoadPointIdX;
|
|
|
|
+ this.modifyPoint.x = info.curvePointInfo.x;
|
|
this.modifyPoint.y = position.y;
|
|
this.modifyPoint.y = position.y;
|
|
- } else if (curvePointInfo.linkedPointIdY) {
|
|
|
|
|
|
+ } else if (info && info.curvePointInfo.linkedRoadPointIdY) {
|
|
this.modifyPoint = {};
|
|
this.modifyPoint = {};
|
|
- this.modifyPoint.linkedPointIdY = curvePointInfo.linkedPointIdY;
|
|
|
|
- this.modifyPoint.y = curvePointInfo.y;
|
|
|
|
|
|
+ this.modifyPoint.linkedRoadPointIdY =
|
|
|
|
+ info.curvePointInfo.linkedRoadPointIdY;
|
|
|
|
+ this.modifyPoint.y = info.curvePointInfo.y;
|
|
this.modifyPoint.x = position.x;
|
|
this.modifyPoint.x = position.x;
|
|
} else {
|
|
} else {
|
|
this.modifyPoint = null;
|
|
this.modifyPoint = null;
|
|
@@ -553,16 +888,16 @@ export default class ListenLayer {
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- } else if (this.modifyPoint.linkedPointId) {
|
|
|
|
|
|
+ } else if (this.modifyPoint.linkedRoadPointId) {
|
|
stateService.setSelectItem(
|
|
stateService.setSelectItem(
|
|
- this.modifyPoint.linkedPointId,
|
|
|
|
|
|
+ this.modifyPoint.linkedRoadPointId,
|
|
VectorType.RoadPoint,
|
|
VectorType.RoadPoint,
|
|
SelectState.Select
|
|
SelectState.Select
|
|
);
|
|
);
|
|
- } else if (this.modifyPoint.linkedCurvePointId) {
|
|
|
|
|
|
+ } else if (this.modifyPoint.linkedCurveRoadPointId) {
|
|
stateService.setSelectItem(
|
|
stateService.setSelectItem(
|
|
- this.modifyPoint.linkedCurvePointId,
|
|
|
|
- VectorType.CurvePoint,
|
|
|
|
|
|
+ this.modifyPoint.linkedCurveRoadPointId,
|
|
|
|
+ VectorType.CurveRoadPoint,
|
|
SelectState.Select
|
|
SelectState.Select
|
|
);
|
|
);
|
|
} else if (this.modifyPoint.linkedRoadId) {
|
|
} else if (this.modifyPoint.linkedRoadId) {
|
|
@@ -586,13 +921,37 @@ export default class ListenLayer {
|
|
} else if (this.modifyPoint.linkedEdgeId) {
|
|
} else if (this.modifyPoint.linkedEdgeId) {
|
|
stateService.setSelectItem(
|
|
stateService.setSelectItem(
|
|
this.modifyPoint.linkedEdgeId,
|
|
this.modifyPoint.linkedEdgeId,
|
|
- VectorType.Edge,
|
|
|
|
|
|
+ VectorType.RoadEdge,
|
|
SelectState.Select
|
|
SelectState.Select
|
|
);
|
|
);
|
|
} else if (this.modifyPoint.linkedCurveEdgeId) {
|
|
} else if (this.modifyPoint.linkedCurveEdgeId) {
|
|
stateService.setSelectItem(
|
|
stateService.setSelectItem(
|
|
this.modifyPoint.linkedCurveEdgeId,
|
|
this.modifyPoint.linkedCurveEdgeId,
|
|
- VectorType.CurveEdge,
|
|
|
|
|
|
+ VectorType.CurveRoadEdge,
|
|
|
|
+ SelectState.Select
|
|
|
|
+ );
|
|
|
|
+ } else if (this.modifyPoint.linkedPointId) {
|
|
|
|
+ stateService.setSelectItem(
|
|
|
|
+ this.modifyPoint.linkedPointId,
|
|
|
|
+ VectorType.Point,
|
|
|
|
+ SelectState.Select
|
|
|
|
+ );
|
|
|
|
+ } else if (this.modifyPoint.linkedCurvePointId) {
|
|
|
|
+ stateService.setSelectItem(
|
|
|
|
+ this.modifyPoint.linkedCurvePointId,
|
|
|
|
+ VectorType.CurvePoint,
|
|
|
|
+ SelectState.Select
|
|
|
|
+ );
|
|
|
|
+ } else if (this.modifyPoint.linkedLineId) {
|
|
|
|
+ stateService.setSelectItem(
|
|
|
|
+ this.modifyPoint.linkedLineId,
|
|
|
|
+ VectorType.Line,
|
|
|
|
+ SelectState.Select
|
|
|
|
+ );
|
|
|
|
+ } else if (this.modifyPoint.linkedCurveLineId) {
|
|
|
|
+ stateService.setSelectItem(
|
|
|
|
+ this.modifyPoint.linkedCurveLineId,
|
|
|
|
+ VectorType.CurveLine,
|
|
SelectState.Select
|
|
SelectState.Select
|
|
);
|
|
);
|
|
}
|
|
}
|