This commit is contained in:
Chumva 2018-07-20 15:52:00 +03:00
parent 12748cb857
commit ac5ab039db
2 changed files with 14 additions and 1 deletions

View file

@ -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);

View file

@ -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;