Skip to content

Additional Cycling Options for MapboxDirections.Builder #900

@kevinkreiser

Description

@kevinkreiser

The recent addition of the Navigator to MapboxNavigator in mapbox/mapbox-navigation-android#1336 lets us key in on some more routing options when in offline-mode. It would be great if we could start exposing some of those options in our URL builder so that offline users can take advantage of those!

Currently the Navigator supports the following additional url parameters for the cycling profile:

&bicycle_type=a&use_roads=1&use_hills=1&use_ferry=1&avoid_bad_surfaces=1

These features are powered by Valhalla and a detailed explanation of what each does can be found in the docs.

Here's a short list of each parameter, and the acceptable value ranges for them. All of them are optional on the url:

  • bicycle_type is a string and can be any of: Hybrid Road City Cross Mountain
  • use_roads is a floating point number from 0.0 to 1.0 inclusive
  • use_hills is a floating point number from 0.0 to 1.0 inclusive
  • use_ferry is a floating point number from 0.0 to 1.0 inclusive
  • avoid_bad_surfaces is a floating point number from 0.0 to 1.0 inclusive
  • cycling_speed is a floating point number from 5kmh to 60kmh

After looking around it it seems like the way to expose them is by adding support for them them to: https://github.com/mapbox/mapbox-java/blob/master/services-directions/src/main/java/com/mapbox/api/directions/v5/MapboxDirections.java

cc @Guardiola31337 @devotaaabel @danesfeder @akitchen @coxchapman @mcwhittemore

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions