|
@@ -56,7 +56,7 @@ export default class ListenLayer {
|
|
|
exceptCurvePointId,
|
|
|
exceptCurveRoadId
|
|
|
) {
|
|
|
- let isSame = false;
|
|
|
+ let flag = false;
|
|
|
this.clear();
|
|
|
let curveRoadInfo = this.isSelectCurveRoad(position, exceptCurveRoadId);
|
|
|
let roadInfo = this.isSelectRoad(position, exceptRoadIds);
|
|
@@ -74,8 +74,8 @@ export default class ListenLayer {
|
|
|
// let flag3 = this.equalAndClone(this.curvePointInfo, curvePointInfo);
|
|
|
// let flag4 = this.equalAndClone(this.pointInfo, pointInfo);
|
|
|
// isSame = this.updateSelectItem(flag1, flag2, flag3, flag4);
|
|
|
- isSame = this.updateSelectItem();
|
|
|
- return !isSame;
|
|
|
+ flag = this.updateSelectItem();
|
|
|
+ return flag;
|
|
|
}
|
|
|
|
|
|
isSelectPoint(position, exceptPointId) {
|
|
@@ -470,14 +470,11 @@ export default class ListenLayer {
|
|
|
bezierData.push(curve.end.y);
|
|
|
const { isHit, getInfo } = bezierUtil.measureBezier(...bezierData);
|
|
|
const { point } = getInfo(position);
|
|
|
-
|
|
|
- if (
|
|
|
- joinInfo.distance == null ||
|
|
|
- mathUtil.getDistance(position, {
|
|
|
- x: point[0],
|
|
|
- y: point[1],
|
|
|
- }) < joinInfo.distance
|
|
|
- ) {
|
|
|
+ const distance = mathUtil.getDistance(position, {
|
|
|
+ x: point[0],
|
|
|
+ y: point[1],
|
|
|
+ });
|
|
|
+ if (joinInfo.distance == null || distance < joinInfo.distance) {
|
|
|
joinInfo.distance = mathUtil.getDistance(position, {
|
|
|
x: point[0],
|
|
|
y: point[1],
|
|
@@ -488,6 +485,10 @@ export default class ListenLayer {
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
+ if (joinInfo.distance != null) {
|
|
|
+ console.log("离曲线距离:" + joinInfo.distance);
|
|
|
+ //position到joinInfo.position的线段
|
|
|
+ }
|
|
|
return joinInfo;
|
|
|
}
|
|
|
|