Merge pull request #11185 from osmandapp/PaulsBranch

Pauls branch
This commit is contained in:
Vitaliy 2021-03-18 11:49:52 +02:00 committed by GitHub
commit 2e04c460b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -245,10 +245,16 @@ public class RoutingOptionsHelper {
TargetPoint pointToStart = tg.getPointToStart(); TargetPoint pointToStart = tg.getPointToStart();
TargetPoint pointToNavigate = tg.getPointToNavigate(); TargetPoint pointToNavigate = tg.getPointToNavigate();
if (rp.getFile().hasRoute()) { if (rp.getFile().hasRoute()) {
tg.clearStartPoint(false); TargetPoint endPoint = selected ? pointToStart : null;
Location finishLoc = ps.get(ps.size() - 1); Location lastLoc = ps.get(ps.size() - 1);
tg.navigateToPoint(new LatLon(finishLoc.getLatitude(), finishLoc.getLongitude()), Location firstLoc = ps.get(0);
false, -1, pointToNavigate != null ? pointToNavigate.getOriginalPointDescription() : null); LatLon firstLatLon = new LatLon(firstLoc.getLatitude(), firstLoc.getLongitude());
LatLon endLocation = endPoint != null ? endPoint.point : new LatLon(lastLoc.getLatitude(), lastLoc.getLongitude());
LatLon startLocation = selected ? firstLatLon : (pointToNavigate != null ? pointToNavigate.point : firstLatLon);
tg.navigateToPoint(endLocation, false, -1);
if (pointToStart != null) {
tg.setStartPoint(startLocation, false, null);
}
tg.updateRouteAndRefresh(true); tg.updateRouteAndRefresh(true);
} else { } else {
Location first = ps.get(0); Location first = ps.get(0);