Fix #5651
This commit is contained in:
parent
12748cb857
commit
ac5ab039db
2 changed files with 14 additions and 1 deletions
|
@ -366,6 +366,18 @@ public class RouteProvider {
|
|||
int[] endI = new int[]{gpxParams.points.size()};
|
||||
if(routeParams.gpxRoute.passWholeRoute) {
|
||||
gpxRoute = gpxParams.points;
|
||||
if (routeParams.previousToRecalculate != null && routeParams.onlyStartPointChanged) {
|
||||
List<Location> routeLocations = routeParams.previousToRecalculate.getRouteLocations();
|
||||
if (routeLocations != null) {
|
||||
Location loc = routeParams.previousToRecalculate.getNextRouteLocation();
|
||||
LatLon nextRouteLocation = new LatLon(loc.getLatitude(), loc.getLongitude());
|
||||
List<Location> routeToNextRouteLocation = findStartAndEndLocationsFromRoute(routeLocations,
|
||||
routeParams.start, nextRouteLocation, null, null);
|
||||
gpxRoute = new ArrayList<>(routeToNextRouteLocation);
|
||||
gpxRoute.addAll(new ArrayList<>(routeLocations));
|
||||
endI = new int[]{gpxRoute.size()};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gpxRoute = findStartAndEndLocationsFromRoute(gpxParams.points,
|
||||
routeParams.start, routeParams.end, startI, endI);
|
||||
|
|
|
@ -957,7 +957,8 @@ public class RoutingHelper {
|
|||
params.intermediates = intermediates;
|
||||
params.gpxRoute = gpxRoute == null ? null : gpxRoute.build(start, settings);
|
||||
params.onlyStartPointChanged = onlyStartPointChanged;
|
||||
if(recalculateCountInInterval < RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE) {
|
||||
if (recalculateCountInInterval < RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE
|
||||
|| (gpxRoute != null && gpxRoute.isPassWholeRoute() && isDeviatedFromRoute)) {
|
||||
params.previousToRecalculate = previousRoute;
|
||||
} else {
|
||||
recalculateCountInInterval = 0;
|
||||
|
|
Loading…
Reference in a new issue