Added check for exsiting intermediates
This commit is contained in:
parent
f859aee1a3
commit
fd88fd347d
1 changed files with 8 additions and 4 deletions
|
@ -251,10 +251,14 @@ public class PointNavigationLayer extends OsmandMapLayer implements
|
||||||
newTargetPoint = targetPointsHelper.getPointToNavigate();
|
newTargetPoint = targetPointsHelper.getPointToNavigate();
|
||||||
} else if (oldPoint.intermediate) {
|
} else if (oldPoint.intermediate) {
|
||||||
List<TargetPoint> points = targetPointsHelper.getIntermediatePointsWithTarget();
|
List<TargetPoint> points = targetPointsHelper.getIntermediatePointsWithTarget();
|
||||||
newTargetPoint = new TargetPoint(position,
|
int i = points.indexOf(oldPoint);
|
||||||
new PointDescription(PointDescription.POINT_TYPE_LOCATION, ""));
|
if (i != -1) {
|
||||||
points.set(points.indexOf(oldPoint), newTargetPoint);
|
newTargetPoint = new TargetPoint(position,
|
||||||
targetPointsHelper.reorderAllTargetPoints(points, true);
|
new PointDescription(PointDescription.POINT_TYPE_LOCATION, ""));
|
||||||
|
points.set(i, newTargetPoint);
|
||||||
|
targetPointsHelper.reorderAllTargetPoints(points, true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue