public enum TravelMode

  1. Object
  2. Enum<TravelMode>
  3. TravelMode

ImplementsComparable<TravelMode>

How the traveller moves, which decides the road network and speeds a RouteService routes over.

Not every backend implements every mode. A service that cannot honor the requested mode answers with the closest profile it does have rather than failing the request, so check the RouteService you installed before promising a user a walking route – see OsrmRouteService for how the built-in default behaves.

Enum constants

DRIVINGRoute over roads open to cars, respecting one-way streets and turn restrictions.
WALKINGRoute over footpaths and pedestrian crossings, ignoring one-way restrictions that do not apply on foot.
CYCLINGRoute over cycleways and bike-legal roads.

Methods

public static TravelMode[] values()
public static TravelMode valueOf(String name)
public String getId()The lowercase wire identifier (driving, walking, cycling) used in routing service URLs.

Inherited methods

Enum constant details

DRIVING

DRIVING
Route over roads open to cars, respecting one-way streets and turn restrictions.

WALKING

WALKING
Route over footpaths and pedestrian crossings, ignoring one-way restrictions that do not apply on foot.

CYCLING

CYCLING
Route over cycleways and bike-legal roads.

Method details

values

public static TravelMode[] values()

valueOf

public static TravelMode valueOf(String name)

getId

public String getId()
The lowercase wire identifier (driving, walking, cycling) used in routing service URLs.