fixed bug 95
This commit is contained in:
parent
a5e87ebd43
commit
e1177cf3ce
2 changed files with 53 additions and 50 deletions
|
@ -213,7 +213,11 @@ public class RoutePlannerFrontEnd {
|
|||
|
||||
private List<RouteSegmentResult> searchRoute(final RoutingContext ctx, List<RouteSegment> points, PrecalculatedRouteDirection routeDirection)
|
||||
throws IOException, InterruptedException {
|
||||
if(points.size() > 2) {
|
||||
if (points.size() <= 2) {
|
||||
ctx.previouslyCalculatedRoute = null;
|
||||
return searchRoute(ctx, points.get(0), points.get(1), routeDirection);
|
||||
}
|
||||
|
||||
ArrayList<RouteSegmentResult> firstPartRecalculatedRoute = null;
|
||||
ArrayList<RouteSegmentResult> restPartRecalculatedRoute = null;
|
||||
if (ctx.previouslyCalculatedRoute != null) {
|
||||
|
@ -240,7 +244,7 @@ public class RoutePlannerFrontEnd {
|
|||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
RoutingContext local = new RoutingContext(ctx);
|
||||
if (i == 0) {
|
||||
local.previouslyCalculatedRoute = firstPartRecalculatedRoute;
|
||||
//local.previouslyCalculatedRoute = firstPartRecalculatedRoute;
|
||||
}
|
||||
local.visitor = ctx.visitor;
|
||||
local.calculationProgress = ctx.calculationProgress;
|
||||
|
@ -265,8 +269,7 @@ public class RoutePlannerFrontEnd {
|
|||
}
|
||||
ctx.unloadAllData();
|
||||
return results;
|
||||
}
|
||||
return searchRoute(ctx, points.get(0), points.get(1), routeDirection);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
|
|
|
@ -670,7 +670,7 @@ public class RouteProvider {
|
|||
ctx.calculationProgress = params.calculationProgress;
|
||||
if(params.previousToRecalculate != null) {
|
||||
// not used any more
|
||||
// ctx.previouslyCalculatedRoute = params.previousToRecalculate.getOriginalRoute();
|
||||
ctx.previouslyCalculatedRoute = params.previousToRecalculate.getOriginalRoute();
|
||||
}
|
||||
LatLon st = new LatLon(params.start.getLatitude(), params.start.getLongitude());
|
||||
LatLon en = new LatLon(params.end.getLatitude(), params.end.getLongitude());
|
||||
|
|
Loading…
Reference in a new issue