Exemple #1
0
 public synchronized void clearCurrentRoute(
     LatLon newFinalLocation, List<LatLon> newIntermediatePoints) {
   route = new RouteCalculationResult("");
   makeUturnWhenPossible = false;
   evalWaitInterval = 3000;
   app.runInUIThread(
       new Runnable() {
         @Override
         public void run() {
           for (IRouteInformationListener l : listeners) {
             l.routeWasCancelled();
           }
         }
       });
   this.finalLocation = newFinalLocation;
   this.intermediatePoints = newIntermediatePoints;
   if (currentRunningJob instanceof RouteRecalculationThread) {
     ((RouteRecalculationThread) currentRunningJob).stopCalculation();
   }
   if (newFinalLocation == null) {
     settings.FOLLOW_THE_ROUTE.set(false);
     settings.FOLLOW_THE_GPX_ROUTE.set(null);
     // clear last fixed location
     this.lastProjection = null;
     setFollowingMode(false);
   }
 }
 public void followRoute(
     ApplicationMode appMode,
     LatLon finalLocation,
     List<LatLon> intermediatePoints,
     net.osmand.Location currentLocation,
     GPXRouteParams gpxRoute) {
   getMapViewTrackingUtilities().backToLocationImpl();
   RoutingHelper routingHelper = app.getRoutingHelper();
   settings.APPLICATION_MODE.set(appMode);
   settings.FOLLOW_THE_ROUTE.set(true);
   if (gpxRoute == null) {
     settings.FOLLOW_THE_GPX_ROUTE.set(null);
   }
   routingHelper.setFollowingMode(true);
   routingHelper.setFinalAndCurrentLocation(
       finalLocation, intermediatePoints, currentLocation, gpxRoute);
   app.showDialogInitializingCommandPlayer(MapActivity.this);
 }