From 77cbb79debc459d6ef31b521857c89f445ac0b81 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 27 Aug 2017 20:20:42 +0300 Subject: [PATCH] Do not show toast in snap to road mode --- .../plus/measurementtool/MeasurementEditingContext.java | 1 + OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index fb84283f77..9d14bb6f82 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -259,6 +259,7 @@ public class MeasurementEditingContext { LatLon end = new LatLon(currentPair.second.getLatitude(), currentPair.second.getLongitude()); final RouteCalculationParams params = new RouteCalculationParams(); + params.inSnapToRoadMode = true; params.start = start; params.end = end; params.leftSide = settings.DRIVING_REGION.get().leftHandDriving; diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 62162f5efd..25c0107676 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -880,8 +880,9 @@ public class RoutingHelper { currentRunningJob = null; } if(res.isCalculated()){ - setNewRoute(prev, res, params.start); - + if (!params.inSnapToRoadMode) { + setNewRoute(prev, res, params.start); + } } else if (onlineSourceWithoutInternet) { lastRouteCalcError = app.getString(R.string.error_calculating_route) + ":\n" + app.getString(R.string.internet_connection_required_for_online_route);