public abstract static class RouteOptions.Builder
extends java.lang.Object
RouteOptions.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract RouteOptions.Builder |
accessToken(java.lang.String accessToken)
A valid Mapbox access token used to making the request.
|
abstract RouteOptions.Builder |
alternatives(java.lang.Boolean alternatives)
Whether to try to return alternative routes (true) or not (false, default).
|
abstract RouteOptions.Builder |
annotations(java.lang.String annotations)
Whether to return additional metadata along the route.
|
RouteOptions.Builder |
annotationsList(java.util.List<java.lang.String> annotations)
Whether to return additional metadata along the route.
|
abstract RouteOptions.Builder |
approaches(java.lang.String approaches)
Indicates from which side of the road to approach a waypoint.
|
RouteOptions.Builder |
approachesList(java.util.List<java.lang.String> approaches)
Indicates from which side of the road to approach a waypoint.
|
abstract RouteOptions.Builder |
bannerInstructions(java.lang.Boolean bannerInstructions)
Whether to return banner objects associated with the route steps (true) or not
(false, default).
|
abstract RouteOptions.Builder |
baseUrl(java.lang.String baseUrl)
The base URL that was used during the request time and resulted in this responses
result.
|
abstract RouteOptions.Builder |
bearings(java.lang.String bearings)
Influences the direction in which a route starts from a waypoint.
|
RouteOptions.Builder |
bearingsList(java.util.List<java.util.List<java.lang.Double>> bearings)
Influences the direction in which a route starts from a waypoint.
|
abstract RouteOptions |
build()
Builds a new instance of the
RouteOptions object. |
abstract RouteOptions.Builder |
continueStraight(java.lang.Boolean continueStraight)
Sets the allowed direction of travel when departing intermediate waypoints.
|
abstract RouteOptions.Builder |
coordinates(java.util.List<com.mapbox.geojson.Point> coordinates)
A list of Points to visit in order.
|
abstract RouteOptions.Builder |
exclude(java.lang.String exclude)
Exclude certain road types from routing.
|
abstract RouteOptions.Builder |
geometries(java.lang.String geometries)
The format of the returned geometry.
|
abstract RouteOptions.Builder |
language(java.lang.String language)
The language of returned turn-by-turn text instructions.
|
abstract RouteOptions.Builder |
overview(java.lang.String overview)
Displays the requested type of overview geometry.
|
abstract RouteOptions.Builder |
profile(java.lang.String profile)
The routing profile to use.
|
abstract RouteOptions.Builder |
radiuses(java.lang.String radiuses)
The maximum distance a coordinate can be moved to snap to the road network in meters.
|
RouteOptions.Builder |
radiusesList(java.util.List<java.lang.Double> radiuses)
The maximum distance a coordinate can be moved to snap to the road network in meters.
|
abstract RouteOptions.Builder |
requestUuid(java.lang.String requestUuid)
A universally unique identifier (UUID) for identifying and executing a similar specific route
in the future.
|
abstract RouteOptions.Builder |
roundaboutExits(java.lang.Boolean roundaboutExits)
Whether to emit instructions at roundabout exits (true) or not (false, default).
|
abstract RouteOptions.Builder |
steps(java.lang.Boolean steps)
Whether to return steps and turn-by-turn instructions (true) or not (false, default).
|
abstract RouteOptions.Builder |
user(java.lang.String user)
The user value that was used during the request.
|
abstract RouteOptions.Builder |
voiceInstructions(java.lang.Boolean voiceInstructions)
Whether to return SSML marked-up text for voice guidance along the route (true) or not
(false, default).
|
abstract RouteOptions.Builder |
voiceUnits(java.lang.String voiceUnits)
Specify which type of units to return in the text for voice instructions.
|
abstract RouteOptions.Builder |
walkingOptions(WalkingOptions walkingOptions)
To be used to specify settings for use with the walking profile.
|
abstract RouteOptions.Builder |
waypointIndices(java.lang.String waypointIndices)
Indicates which input coordinates should be treated as waypoints.
|
RouteOptions.Builder |
waypointIndicesList(java.util.List<java.lang.Integer> indices)
Indicates which input coordinates should be treated as waypoints.
|
abstract RouteOptions.Builder |
waypointNames(java.lang.String waypointNames)
A semicolon-separated list of custom names for entries in the list of
RouteOptions.coordinates(), used for the arrival instruction in banners and voice
instructions. |
RouteOptions.Builder |
waypointNamesList(java.util.List<java.lang.String> waypointNames)
A semicolon-separated list of custom names for entries in the list of
RouteOptions.coordinates(), used for the arrival instruction in banners and voice
instructions. |
abstract RouteOptions.Builder |
waypointTargets(java.lang.String waypointTargets)
A semicolon-separated list of coordinate pairs used to specify drop-off
locations that are distinct from the locations specified in coordinates.
|
RouteOptions.Builder |
waypointTargetsList(java.util.List<com.mapbox.geojson.Point> waypointTargets)
A list of coordinate pairs used to specify drop-off
locations that are distinct from the locations specified in coordinates.
|
public abstract RouteOptions.Builder baseUrl(@NonNull java.lang.String baseUrl)
baseUrl - base URL used for original requestpublic abstract RouteOptions.Builder user(@NonNull java.lang.String user)
user - string representing the user field in the calling urlpublic abstract RouteOptions.Builder profile(@NonNull java.lang.String profile)
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC,
DirectionsCriteria.PROFILE_DRIVING, DirectionsCriteria.PROFILE_WALKING, or
DirectionsCriteria.PROFILE_CYCLING.
The same profile which was used during the request that resulted in this root directions
response. MapboxDirections.Builder ensures that a profile is always set even if the
MapboxDirections requesting object doesn't specifically set a profile.profile - One of the direction profiles defined in
DirectionsCriteria.ProfileCriteriapublic abstract RouteOptions.Builder coordinates(@NonNull java.util.List<com.mapbox.geojson.Point> coordinates)
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC requests.
Note that these coordinates are different than the direction responses
DirectionsWaypoints that these are the non-snapped coordinates.coordinates - a list of Points which represent the route origin, destination,
and optionally, waypointspublic abstract RouteOptions.Builder alternatives(@NonNull java.lang.Boolean alternatives)
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC,
DirectionsCriteria.PROFILE_DRIVING, DirectionsCriteria.PROFILE_CYCLING.alternatives - true if the request contained additional route request, otherwise falsepublic abstract RouteOptions.Builder language(@NonNull java.lang.String language)
RouteOptions.steps() = true.language - a string with the language which was requested in the urlpublic abstract RouteOptions.Builder radiuses(@NonNull java.lang.String radiuses)
radiuses - a String of radius values, each separated by ;.public RouteOptions.Builder radiusesList(@NonNull java.util.List<java.lang.Double> radiuses)
Double.POSITIVE_INFINITY.radiuses - a list of radius valuespublic abstract RouteOptions.Builder bearings(@NonNull java.lang.String bearings)
bearings - a string representing the bearings with the ; separator. Angle and degrees
for every bearing value are comma-separated.public RouteOptions.Builder bearingsList(@NonNull java.util.List<java.util.List<java.lang.Double>> bearings)
bearings - a List of list of doubles representing the bearings used in the original
request. The first value in the list is the angle, the second one is the
degrees.public abstract RouteOptions.Builder continueStraight(@NonNull java.lang.Boolean continueStraight)
DirectionsCriteria.PROFILE_DRIVING
and false for DirectionsCriteria.PROFILE_WALKING and
DirectionsCriteria.PROFILE_CYCLING.continueStraight - true if you'd like the user to continue straight from the starting
pointpublic abstract RouteOptions.Builder roundaboutExits(@NonNull java.lang.Boolean roundaboutExits)
steps(Boolean)roundaboutExits - true if you'd like extra roundabout instructionspublic abstract RouteOptions.Builder geometries(@NonNull java.lang.String geometries)
DirectionsCriteria.GEOMETRY_POLYLINE (default, a polyline with a precision of five
decimal places), DirectionsCriteria.GEOMETRY_POLYLINE6 (a polyline with a precision
of six decimal places).
A null value will reset this field to the APIs default value vs this SDKs default value of
DirectionsCriteria.GEOMETRY_POLYLINE6.geometries - one of the options found in DirectionsCriteria.GeometriesCriteria.public abstract RouteOptions.Builder overview(@NonNull java.lang.String overview)
DirectionsCriteria.OVERVIEW_FULL (the most detailed geometry
available), DirectionsCriteria.OVERVIEW_SIMPLIFIED (default, a simplified version of
the full geometry), or DirectionsCriteria.OVERVIEW_FALSE (no overview geometry).overview - one of the options found in DirectionsCriteria.OverviewCriteriapublic abstract RouteOptions.Builder steps(@NonNull java.lang.Boolean steps)
RouteOptions.bannerInstructions(), RouteOptions.language(),
RouteOptions.roundaboutExits(), RouteOptions.voiceInstructions(),
RouteOptions.voiceUnits(), RouteOptions.waypointNamesList(),
RouteOptions.waypointTargetsList(), waypoints from RouteOptions.coordinates()steps - true if you'd like step information, false otherwisepublic abstract RouteOptions.Builder annotations(@NonNull java.lang.String annotations)
DirectionsCriteria.ANNOTATION_DURATION
DirectionsCriteria.ANNOTATION_DISTANCE
DirectionsCriteria.ANNOTATION_SPEED
DirectionsCriteria.ANNOTATION_CONGESTION
DirectionsCriteria.ANNOTATION_MAXSPEED
You can include several annotations as a comma-separated list. See the
RouteLeg object for more details on what is included with annotations.
Must be used in conjunction with overview=full.annotations - in string format and separated by commas if more than one annotation was
requestedpublic RouteOptions.Builder annotationsList(@NonNull java.util.List<java.lang.String> annotations)
DirectionsCriteria.ANNOTATION_DURATION
DirectionsCriteria.ANNOTATION_DISTANCE
DirectionsCriteria.ANNOTATION_SPEED
DirectionsCriteria.ANNOTATION_CONGESTION
DirectionsCriteria.ANNOTATION_MAXSPEED
See the RouteLeg object for more details on what is included with
annotations.
Must be used in conjunction with overview=full.annotations - a list of annotationspublic abstract RouteOptions.Builder voiceInstructions(@NonNull java.lang.Boolean voiceInstructions)
steps(Boolean).voiceInstructions - true if the original request included voice instructionspublic abstract RouteOptions.Builder bannerInstructions(@NonNull java.lang.Boolean bannerInstructions)
steps(Boolean)bannerInstructions - true if the original request included banner instructionspublic abstract RouteOptions.Builder voiceUnits(@NonNull java.lang.String voiceUnits)
DirectionsCriteria.IMPERIAL (default) or DirectionsCriteria.METRIC.
Must be used in conjunction with steps(Boolean)=true and
voiceInstructions(Boolean)=true.voiceUnits - string matching either imperial or metricpublic abstract RouteOptions.Builder accessToken(@NonNull java.lang.String accessToken)
accessToken - a string containing a valid Mapbox access tokenpublic abstract RouteOptions.Builder requestUuid(@NonNull java.lang.String requestUuid)
requestUuid - a string containing the request UUIDpublic abstract RouteOptions.Builder exclude(@NonNull java.lang.String exclude)
DirectionsCriteria.PROFILE_DRIVING: One of DirectionsCriteria.EXCLUDE_TOLL,
DirectionsCriteria.EXCLUDE_MOTORWAY, or DirectionsCriteria.EXCLUDE_FERRY.
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC: One of
DirectionsCriteria.EXCLUDE_TOLL, DirectionsCriteria.EXCLUDE_MOTORWAY, or
DirectionsCriteria.EXCLUDE_FERRY.
DirectionsCriteria.PROFILE_WALKING: No excludes supported
DirectionsCriteria.PROFILE_CYCLING: DirectionsCriteria.EXCLUDE_FERRYexclude - a string matching one of the DirectionsCriteria.ExcludeCriteria
exclusionspublic abstract RouteOptions.Builder approaches(@NonNull java.lang.String approaches)
DirectionsCriteria.APPROACH_UNRESTRICTED (default) or
DirectionsCriteria.APPROACH_CURB .
If set to DirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints
from either side of the road.
If set to DirectionsCriteria.APPROACH_CURB, the route will be returned so that on
arrival, the waypoint will be found on the side that corresponds with the driving_side of the
region in which the returned route is located.
If provided, the list of approaches must be the same length as the list of waypoints.
However, you can skip a coordinate and show its position in the list with the ; separator.
The same approaches the user originally made when the request was made.approaches - unrestricted, curb or omitted (;)public RouteOptions.Builder approachesList(@NonNull java.util.List<java.lang.String> approaches)
DirectionsCriteria.APPROACH_UNRESTRICTED (default) or
DirectionsCriteria.APPROACH_CURB .
If set to DirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints
from either side of the road.
If set to DirectionsCriteria.APPROACH_CURB, the route will be returned so that on
arrival, the waypoint will be found on the side that corresponds with the driving_side of the
region in which the returned route is located.
If provided, the list of approaches must be the same length as the list of waypoints.
However, you can skip a coordinate and show its position in the list with null value.
The same approaches the user originally made when the request was made.approaches - a list of Stringspublic abstract RouteOptions.Builder waypointIndices(@NonNull java.lang.String waypointIndices)
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
RouteOptions.steps()
waypointIndices - to be used as waypointspublic RouteOptions.Builder waypointIndicesList(@NonNull java.util.List<java.lang.Integer> indices)
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates'.
RouteOptions.steps()
indices - a list to be used as waypointspublic abstract RouteOptions.Builder waypointNames(@NonNull java.lang.String waypointNames)
RouteOptions.coordinates(), used for the arrival instruction in banners and voice
instructions. Values can be any string, and the total number of all characters cannot exceed
500. If provided, the list of waypoint_names must be the same length as the list of
coordinates, but you can skip a coordinate pair and show its position in the list with the ;
separator. The first value in the list corresponds to the route origin, not the first
destination. To leave the origin unnamed, begin the list with a semicolon.
Must be used in conjunction with steps(Boolean) = true.waypointNames - unrestricted, curb or omitted (;)public RouteOptions.Builder waypointNamesList(@NonNull java.util.List<java.lang.String> waypointNames)
RouteOptions.coordinates(), used for the arrival instruction in banners and voice
instructions. Values can be any string, and the total number of all characters cannot exceed
500. If provided, the list of waypoint_names must be the same length as the list of
coordinates, but you can skip a coordinate pair and show its position in the list with the
null value. The first value in the list corresponds to the route origin, not the first
destination. To leave the origin unnamed, begin the list with a null value.
Must be used in conjunction with steps(Boolean) = true.waypointNames - a list of Stringspublic abstract RouteOptions.Builder waypointTargets(@NonNull java.lang.String waypointTargets)
steps(Boolean) = true.
The same waypoint targets the user originally made when the request was made.waypointTargets - list of coordinate pairs for drop-off locations (;)public RouteOptions.Builder waypointTargetsList(@NonNull java.util.List<com.mapbox.geojson.Point> waypointTargets)
steps(Boolean) = true.
The same waypoint targets the user originally made when the request was made.waypointTargets - list of Points for drop-off locationspublic abstract RouteOptions.Builder walkingOptions(@NonNull WalkingOptions walkingOptions)
walkingOptions - options to use for walking profilepublic abstract RouteOptions build()
RouteOptions object.RouteOptions instance