diff --git a/OsmAnd-java/src/net/osmand/router/RouteCalculationProgress.java b/OsmAnd-java/src/net/osmand/router/RouteCalculationProgress.java index 21f47411cf..2f946335fb 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteCalculationProgress.java +++ b/OsmAnd-java/src/net/osmand/router/RouteCalculationProgress.java @@ -15,6 +15,9 @@ public class RouteCalculationProgress { public int loadedTiles = 0; public int visitedSegments = 0; + public int totalIterations = 1; + public int iteration = 1; + public boolean isCancelled; public boolean requestPrivateAccessRouting; } diff --git a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java index d2779cdfb4..a1bd30cfb7 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java @@ -158,6 +158,8 @@ public class RoutePlannerFrontEnd { } if (ctx.calculationMode == RouteCalculationMode.COMPLEX && routeDirection == null && maxDistance > ctx.config.DEVIATION_RADIUS * 6) { + ctx.calculationProgress.totalIterations++; + ctx.calculationProgress.iteration++; RoutingContext nctx = buildRoutingContext(ctx.config, ctx.nativeLib, ctx.getMaps(), RouteCalculationMode.BASE); nctx.calculationProgress = ctx.calculationProgress; List ls = searchRoute(nctx, start, end, intermediates); @@ -197,6 +199,7 @@ public class RoutePlannerFrontEnd { if (!addSegment(end, ctx, indexNotFound++, points)) { return null; } + ctx.calculationProgress.iteration++; List res = searchRoute(ctx, points, routeDirection); // make start and end more precise makeStartEndPointsPrecise(res, start, end, intermediates);