fixed jira issue 92. Cancelling recalculation of route if it was already calculated.

This commit is contained in:
unknown 2014-06-26 19:18:34 +03:00
parent d3a5fe8b27
commit be10b3dfbb

View file

@ -288,7 +288,11 @@ public class RoutingHelper {
if (calculateRoute) {
recalculateRouteInBackground(false, currentLocation, finalLocation, intermediatePoints, currentGPXRoute,
previousRoute.isCalculated() ? previousRoute : null);
} else if (currentRunningJob != null && currentRunningJob instanceof RouteRecalculationThread) {
RouteRecalculationThread thread = (RouteRecalculationThread) currentRunningJob;
thread.stopCalculation();
}
double projectDist = mode != null && mode.hasFastSpeed() ? posTolerance : posTolerance / 2;
if(returnUpdatedLocation && locationProjection != null && currentLocation.distanceTo(locationProjection) < projectDist) {
return locationProjection;