Enum TravelMode

java.lang.Object
java.lang.Enum<TravelMode>
com.codename1.maps.routing.TravelMode
All Implemented Interfaces:
Comparable<TravelMode>

public enum TravelMode extends Enum<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 Constant Details

    • DRIVING

      public static final TravelMode DRIVING
      Route over roads open to cars, respecting one-way streets and turn restrictions.
    • WALKING

      public static final TravelMode WALKING
      Route over footpaths and pedestrian crossings, ignoring one-way restrictions that do not apply on foot.
    • CYCLING

      public static final TravelMode CYCLING
      Route over cycleways and bike-legal roads.
  • Method Details

    • values

      public static TravelMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TravelMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

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