From fcc9723aaa9809daa96cd4d4b00c293678053d31 Mon Sep 17 00:00:00 2001 From: vodie <45155869+vodie@users.noreply.github.com> Date: Tue, 11 Jun 2019 00:20:05 +0200 Subject: [PATCH] Update RouteProvider.java --- OsmAnd/src/net/osmand/plus/routing/RouteProvider.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java index 99f8288327..d4ea4f96ee 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java @@ -1139,7 +1139,6 @@ public class RouteProvider { double[] lons = new double[numpoints]; int index = 0; String mode; - float defSpeed; boolean addMissingTurns = true; lats[index] = params.start.getLatitude(); lons[index] = params.start.getLongitude(); @@ -1155,13 +1154,10 @@ public class RouteProvider { lons[index] = params.end.getLongitude(); if (ApplicationMode.PEDESTRIAN == params.mode) { mode = "foot"; //$NON-NLS-1$ - defSpeed = (float) (5/3.6); } else if (ApplicationMode.BICYCLE == params.mode) { mode = "bicycle"; //$NON-NLS-1$ - defSpeed = (float) (20/3.6); } else { mode = "motorcar"; //$NON-NLS-1$ - defSpeed = (float) (60/3.6); } Bundle bpars = new Bundle(); bpars.putDoubleArray("lats", lats); @@ -1189,7 +1185,7 @@ public class RouteProvider { GPXFile gpxFile = GPXUtilities.loadGPXFile(new ByteArrayInputStream(gpxMessage.getBytes("UTF-8"))); - dir = parseOsmAndGPXRoute(res, gpxFile, true, params.leftSide, defSpeed); + dir = parseOsmAndGPXRoute(res, gpxFile, true, params.leftSide, params.mode.getDefaultSpeed()); if (dir != null) { addMissingTurns = false;