From 973fc013aadd4f92c21e8741c5eae440a7ff9f39 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 11 Feb 2020 12:48:20 +0200 Subject: [PATCH] Fix #8304 --- .../main/java/net/osmand/router/GeneralRouter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java index d8e54ecaf5..c825aeb1d9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java @@ -135,12 +135,9 @@ public class GeneralRouter implements VehicleRouter { for (int i = 0; i < objectAttributes.length; i++) { objectAttributes[i] = new RouteAttributeContext(parent.objectAttributes[i], params); } - allowPrivate = params.containsKey(ALLOW_PRIVATE) && parseSilentBoolean(params.get(ALLOW_PRIVATE), false) ; + allowPrivate = params.containsKey(ALLOW_PRIVATE) && parseSilentBoolean(params.get(ALLOW_PRIVATE), false); shortestRoute = params.containsKey(USE_SHORTEST_WAY) && parseSilentBoolean(params.get(USE_SHORTEST_WAY), false); - heightObstacles = params.containsKey(USE_HEIGHT_OBSTACLES) && parseSilentBoolean(params.get(USE_HEIGHT_OBSTACLES), false); - if(shortestRoute) { - maxSpeed = Math.min(CAR_SHORTEST_DEFAULT_SPEED, maxSpeed); - } + heightObstacles = params.containsKey(USE_HEIGHT_OBSTACLES) && parseSilentBoolean(params.get(USE_HEIGHT_OBSTACLES), false); if (params.containsKey(DEFAULT_SPEED)) { defaultSpeed = parseSilentFloat(params.get(DEFAULT_SPEED), defaultSpeed); } @@ -150,8 +147,10 @@ public class GeneralRouter implements VehicleRouter { if (params.containsKey(MAX_SPEED)) { maxSpeed = parseSilentFloat(params.get(MAX_SPEED), maxSpeed); } + if (shortestRoute) { + maxSpeed = Math.min(CAR_SHORTEST_DEFAULT_SPEED, maxSpeed); + } initCaches(); - } public GeneralRouter(GeneralRouterProfile profile, Map attributes) {