Fix - remove waypoints after restart

This commit is contained in:
Alexey Kulish 2016-02-23 13:30:20 +03:00
parent ab89f89356
commit 19297a7bd0
2 changed files with 7 additions and 0 deletions

View file

@ -250,6 +250,10 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents,
if (settings.FOLLOW_THE_ROUTE.get() && !app.getRoutingHelper().isRouteCalculated() if (settings.FOLLOW_THE_ROUTE.get() && !app.getRoutingHelper().isRouteCalculated()
&& !app.getRoutingHelper().isRouteBeingCalculated()) { && !app.getRoutingHelper().isRouteBeingCalculated()) {
FailSafeFuntions.restoreRoutingMode(this); FailSafeFuntions.restoreRoutingMode(this);
} else if (app.getSettings().USE_MAP_MARKERS.get()
&& !app.getRoutingHelper().isRoutePlanningMode() && app.getTargetPointsHelper().getAllPoints().size() > 0) {
app.getRoutingHelper().clearCurrentRoute(null, new ArrayList<LatLon>());
app.getTargetPointsHelper().removeAllWayPoints(false);
} }
if (!settings.isLastKnownMapLocation()) { if (!settings.isLastKnownMapLocation()) {

View file

@ -183,6 +183,9 @@ public class FailSafeFuntions {
private static void notRestoreRoutingMode(MapActivity ma, OsmandApplication app){ private static void notRestoreRoutingMode(MapActivity ma, OsmandApplication app){
ma.updateApplicationModeSettings(); ma.updateApplicationModeSettings();
app.getRoutingHelper().clearCurrentRoute(null, new ArrayList<LatLon>()); app.getRoutingHelper().clearCurrentRoute(null, new ArrayList<LatLon>());
if (app.getSettings().USE_MAP_MARKERS.get()) {
app.getTargetPointsHelper().removeAllWayPoints(false);
}
ma.refreshMap(); ma.refreshMap();
} }