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 2a3a7403a1..de8aeac47c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/GeneralRouter.java @@ -38,6 +38,7 @@ public class GeneralRouter implements VehicleRouter { public static final String MAX_SPEED = "max_speed"; public static final String VEHICLE_HEIGHT = "height"; public static final String VEHICLE_WEIGHT = "weight"; + public static final String VEHICLE_WIDTH = "width"; private final RouteAttributeContext[] objectAttributes; public final Map attributes; diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index c51bd9f8c4..394f5e9e9a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -1916,6 +1916,8 @@ Avoid crossing national borders Weight limit Specify permitted vehicle weight limit on routes. + Width limit + Specify permitted vehicle width limit on routes. Height limit Specify vehicle height to be permitted on routes. Since Android version 4.4 (KitKat) you cannot download and update maps to the old storage folder (%s). Copy all OsmAnd files to new storage location? diff --git a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java index e71e40a906..3a16d9ef9b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java @@ -133,6 +133,7 @@ public class RouteParametersFragment extends BaseSettingsFragment { } else if (!param.equals(GeneralRouter.USE_SHORTEST_WAY) && !param.equals(GeneralRouter.VEHICLE_HEIGHT) && !param.equals(GeneralRouter.VEHICLE_WEIGHT) + && !param.equals(GeneralRouter.VEHICLE_WIDTH) && !RoutingOptionsHelper.DRIVING_STYLE.equals(routingParameter.getGroup())) { otherRoutingParameters.add(routingParameter); } diff --git a/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java index bb6def6f65..f3bbf37632 100644 --- a/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java @@ -46,6 +46,10 @@ public class VehicleParametersFragment extends BaseSettingsFragment { if (vehicleWeight != null) { setupCustomRoutingPropertyPref(vehicleWeight); } + GeneralRouter.RoutingParameter vehicleWidth = parameters.get(GeneralRouter.VEHICLE_WIDTH); + if (vehicleWidth != null) { + setupCustomRoutingPropertyPref(vehicleWidth); + } if (router.getProfile() != GeneralRouter.GeneralRouterProfile.PUBLIC_TRANSPORT) { setupDefaultSpeedPref(); } @@ -111,6 +115,8 @@ public class VehicleParametersFragment extends BaseSettingsFragment { return getIcon(R.drawable.ic_action_height_limit); case GeneralRouter.VEHICLE_WEIGHT: return getIcon(R.drawable.ic_action_weight_limit); + case GeneralRouter.VEHICLE_WIDTH: + return getIcon(R.drawable.ic_action_width_limit); default: return null; }