类 RouteOptions.Builder
java.lang.Object
ai.nextbillion.kits.directions.models.RouteOptions.Builder
- 封闭类:
- RouteOptions
This builder can be used to set the values describing the
RouteOptions.-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract RouteOptions.BuilderaccessToken(String accessToken) A valid Nbmap access token used to making the request.abstract RouteOptions.Builderalternatives(Boolean alternatives) Whether to try to return alternative routes (true) or not (false, default).abstract RouteOptions.Builderannotations(String annotations) Whether to return additional metadata along the route.annotationsList(List<String> annotations) Whether to return additional metadata along the route.abstract RouteOptions.Builderapproaches(String approaches) Indicates from which side of the road to approach a waypoint.approachesList(List<String> approaches) Indicates from which side of the road to approach a waypoint.abstract RouteOptions.BuilderbannerInstructions(Boolean bannerInstructions) Whether to return banner objects associated with the route steps (true) or not (false, default).abstract RouteOptions.BuilderThe base URL that was used during the request time and resulted in this responses result.abstract RouteOptions.BuilderInfluences the direction in which a route starts from a waypoint.bearingsList(List<List<Double>> bearings) Influences the direction in which a route starts from a waypoint.abstract RouteOptionsbuild()Builds a new instance of theRouteOptionsobject.abstract RouteOptions.BuildercontinueStraight(Boolean continueStraight) Sets the allowed direction of travel when departing intermediate waypoints.abstract RouteOptions.Buildercoordinates(List<ai.nextbillion.kits.geojson.Point> coordinates) A list of Points to visit in order.abstract RouteOptions.BuilderExclude certain road types from routing.abstract RouteOptions.Buildergeometries(String geometries) The format of the returned geometry.abstract RouteOptions.BuilderThe language of returned turn-by-turn text instructions.abstract RouteOptions.BuilderDisplays the requested type of overview geometry.abstract RouteOptions.BuilderThe routing profile to use.abstract RouteOptions.BuilderThe maximum distance a coordinate can be moved to snap to the road network in meters.radiusesList(List<Double> radiuses) The maximum distance a coordinate can be moved to snap to the road network in meters.abstract RouteOptions.BuilderrequestUuid(String requestUuid) A universally unique identifier (UUID) for identifying and executing a similar specific route in the future.abstract RouteOptions.BuilderroundaboutExits(Boolean roundaboutExits) Whether to emit instructions at roundabout exits (true) or not (false, default).abstract RouteOptions.BuildersnappingClosures(String snappingClosures) A semicolon-separated list of booleans affecting snapping of waypoint locations to road segments.snappingClosures(List<Boolean> snappingClosures) A list of booleans affecting snapping of waypoint locations to road segments.abstract RouteOptions.BuilderWhether to return steps and turn-by-turn instructions (true) or not (false, default).abstract RouteOptions.BuilderThe user value that was used during the request.abstract RouteOptions.BuildervoiceInstructions(Boolean voiceInstructions) Whether to return SSML marked-up text for voice guidance along the route (true) or not (false, default).abstract RouteOptions.BuildervoiceUnits(String voiceUnits) Specify which type of units to return in the text for voice instructions.abstract RouteOptions.BuilderwalkingOptions(WalkingOptions walkingOptions) To be used to specify settings for use with the walking profile.abstract RouteOptions.BuilderwaypointIndices(String waypointIndices) Indicates which input coordinates should be treated as waypoints.waypointIndicesList(List<Integer> indices) Indicates which input coordinates should be treated as waypoints.abstract RouteOptions.BuilderwaypointNames(String waypointNames) A semicolon-separated list of custom names for entries in the list ofRouteOptions.coordinates(), used for the arrival instruction in banners and voice instructions.waypointNamesList(List<String> waypointNames) A semicolon-separated list of custom names for entries in the list ofRouteOptions.coordinates(), used for the arrival instruction in banners and voice instructions.abstract RouteOptions.BuilderwaypointTargets(String waypointTargets) A semicolon-separated list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates.waypointTargetsList(List<ai.nextbillion.kits.geojson.Point> waypointTargets) A list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
baseUrl
The base URL that was used during the request time and resulted in this responses result.- 参数:
baseUrl- base URL used for original request- 返回:
- this builder for chaining options together
-
user
The user value that was used during the request.- 参数:
user- string representing the user field in the calling url- 返回:
- this builder for chaining options together
-
profile
The routing profile to use. Possible values areDirectionsCriteria.PROFILE_DRIVING_TRAFFIC,DirectionsCriteria.PROFILE_DRIVING,DirectionsCriteria.PROFILE_WALKING, orDirectionsCriteria.PROFILE_CYCLING. The same profile which was used during the request that resulted in this root directions response. NbmapDirections.Builder ensures that a profile is always set even if the NbmapDirections requesting object doesn't specifically set a profile.- 参数:
profile- One of the direction profiles defined inDirectionsCriteria.ProfileCriteria- 返回:
- this builder for chaining options together
-
coordinates
public abstract RouteOptions.Builder coordinates(@NonNull List<ai.nextbillion.kits.geojson.Point> coordinates) A list of Points to visit in order. There can be between two and 25 coordinates for most requests, or up to three coordinates forDirectionsCriteria.PROFILE_DRIVING_TRAFFICrequests. Note that these coordinates are different than the direction responsesDirectionsWaypoints that these are the non-snapped coordinates.- 参数:
coordinates- a list ofPoints which represent the route origin, destination, and optionally, waypoints- 返回:
- this builder for chaining options together
-
alternatives
Whether to try to return alternative routes (true) or not (false, default). An alternative route is a route that is significantly different than the fastest route, but also still reasonably fast. Such a route does not exist in all circumstances. Up to two alternatives may be returned. This is available forDirectionsCriteria.PROFILE_DRIVING_TRAFFIC,DirectionsCriteria.PROFILE_DRIVING,DirectionsCriteria.PROFILE_CYCLING.- 参数:
alternatives- true if the request contained additional route request, otherwise false- 返回:
- this builder for chaining options together
-
language
The language of returned turn-by-turn text instructions. The default is en (English). Must be used in conjunction withRouteOptions.steps()= true.- 参数:
language- a string with the language which was requested in the url- 返回:
- this builder for chaining options together
-
radiuses
The maximum distance a coordinate can be moved to snap to the road network in meters. There must be as many radiuses as there are coordinates in the request, each separated by ;. Values can be any number greater than 0 or the string unlimited.- 参数:
radiuses- a String of radius values, each separated by ;.- 返回:
- this builder for chaining options together
-
radiusesList
The maximum distance a coordinate can be moved to snap to the road network in meters. There must be as many radiuses as there are coordinates in the request. Values can be any number greater than 0 orDouble.POSITIVE_INFINITY.- 参数:
radiuses- a list of radius values- 返回:
- this builder for chaining options together
-
bearings
Influences the direction in which a route starts from a waypoint. Used to filter the road segment the waypoint will be placed on by direction. This is useful for making sure the new routes of rerouted vehicles continue traveling in their current direction. A request that does this would provide bearing and radius values for the first waypoint and leave the remaining values empty. Takes two comma-separated values per waypoint: an angle clockwise from true north between 0 and 360, and the range of degrees by which the angle can deviate (recommended value is 45° or 90°), formatted as {angle, degrees}. If provided, the list of bearings must be the same length as the list of coordinates. However, you can skip a coordinate and show its position in the list with the ; separator.- 参数:
bearings- a string representing the bearings with the ; separator. Angle and degrees for every bearing value are comma-separated.- 返回:
- this builder for chaining options together
-
bearingsList
Influences the direction in which a route starts from a waypoint. Used to filter the road segment the waypoint will be placed on by direction. This is useful for making sure the new routes of rerouted vehicles continue traveling in their current direction. A request that does this would provide bearing and radius values for the first waypoint and leave the remaining values empty. Takes a List of list of doubles: the first value in the list is an angle clockwise from true north between 0 and 360, the second value is the range of degrees by which the angle can deviate (recommended value is 45° or 90°). If provided, the list of bearings must be the same length as the list of coordinates. However, you can skip a coordinate and show its position in the list with the null value.- 参数:
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.- 返回:
- this builder for chaining options together
-
continueStraight
Sets the allowed direction of travel when departing intermediate waypoints. If true, the route will continue in the same direction of travel. If false, the route may continue in the opposite direction of travel. Defaults to true forDirectionsCriteria.PROFILE_DRIVINGand false forDirectionsCriteria.PROFILE_WALKINGandDirectionsCriteria.PROFILE_CYCLING.- 参数:
continueStraight- true if you'd like the user to continue straight from the starting point- 返回:
- this builder for chaining options together
-
roundaboutExits
Whether to emit instructions at roundabout exits (true) or not (false, default). Without this parameter, roundabout maneuvers are given as a single instruction that includes both entering and exiting the roundabout. With roundabout_exits=true, this maneuver becomes two instructions, one for entering the roundabout and one for exiting it. Must be used in conjunction withsteps(Boolean)- 参数:
roundaboutExits- true if you'd like extra roundabout instructions- 返回:
- this builder for chaining options together
-
geometries
The format of the returned geometry. Allowed values are: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 ofDirectionsCriteria.GEOMETRY_POLYLINE6.- 参数:
geometries- one of the options found inDirectionsCriteria.GeometriesCriteria.- 返回:
- this builder for chaining options together
-
overview
Displays the requested type of overview geometry. Can beDirectionsCriteria.OVERVIEW_FULL(the most detailed geometry available),DirectionsCriteria.OVERVIEW_SIMPLIFIED(default, a simplified version of the full geometry), orDirectionsCriteria.OVERVIEW_FALSE(no overview geometry).- 参数:
overview- one of the options found inDirectionsCriteria.OverviewCriteria- 返回:
- this builder for chaining options together
-
steps
Whether to return steps and turn-by-turn instructions (true) or not (false, default). If steps is set to true, the following guidance-related parameters will be available:RouteOptions.bannerInstructions(),RouteOptions.language(),RouteOptions.roundaboutExits(),RouteOptions.voiceInstructions(),RouteOptions.voiceUnits(),RouteOptions.waypointNamesList(),RouteOptions.waypointTargetsList(), waypoints fromRouteOptions.coordinates()- 参数:
steps- true if you'd like step information, false otherwise- 返回:
- this builder for chaining options together
-
annotations
Whether to return additional metadata along the route. Possible values are:DirectionsCriteria.ANNOTATION_DURATIONDirectionsCriteria.ANNOTATION_DISTANCEDirectionsCriteria.ANNOTATION_SPEEDDirectionsCriteria.ANNOTATION_CONGESTIONDirectionsCriteria.ANNOTATION_MAXSPEEDYou can include several annotations as a comma-separated list. See theRouteLegobject 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 requested- 返回:
- this builder for chaining options together
-
annotationsList
Whether to return additional metadata along the route. Possible values are:DirectionsCriteria.ANNOTATION_DURATIONDirectionsCriteria.ANNOTATION_DISTANCEDirectionsCriteria.ANNOTATION_SPEEDDirectionsCriteria.ANNOTATION_CONGESTIONDirectionsCriteria.ANNOTATION_MAXSPEEDSee theRouteLegobject for more details on what is included with annotations. Must be used in conjunction with overview=full.- 参数:
annotations- a list of annotations- 返回:
- this builder for chaining options together
-
voiceInstructions
Whether to return SSML marked-up text for voice guidance along the route (true) or not (false, default). Must be used in conjunction withsteps(Boolean).- 参数:
voiceInstructions- true if the original request included voice instructions- 返回:
- this builder for chaining options together
-
bannerInstructions
Whether to return banner objects associated with the route steps (true) or not (false, default). Must be used in conjunction withsteps(Boolean)- 参数:
bannerInstructions- true if the original request included banner instructions- 返回:
- this builder for chaining options together
-
voiceUnits
Specify which type of units to return in the text for voice instructions. Can beDirectionsCriteria.IMPERIAL(default) orDirectionsCriteria.METRIC. Must be used in conjunction withsteps(Boolean)=true andvoiceInstructions(Boolean)=true.- 参数:
voiceUnits- string matching either imperial or metric- 返回:
- this builder for chaining options together
-
accessToken
A valid Nbmap access token used to making the request.- 参数:
accessToken- a string containing a valid Nbmap access token- 返回:
- this builder for chaining options together
-
requestUuid
A universally unique identifier (UUID) for identifying and executing a similar specific route in the future.- 参数:
requestUuid- a string containing the request UUID- 返回:
- this builder for chaining options together
-
exclude
Exclude certain road types from routing. The default is to not exclude anything from the profile selected. The following exclude flags are available for each profile:DirectionsCriteria.PROFILE_DRIVING: One ofDirectionsCriteria.EXCLUDE_TOLL,DirectionsCriteria.EXCLUDE_MOTORWAY, orDirectionsCriteria.EXCLUDE_FERRY.DirectionsCriteria.PROFILE_DRIVING_TRAFFIC: One ofDirectionsCriteria.EXCLUDE_TOLL,DirectionsCriteria.EXCLUDE_MOTORWAY, orDirectionsCriteria.EXCLUDE_FERRY.DirectionsCriteria.PROFILE_WALKING: No excludes supportedDirectionsCriteria.PROFILE_CYCLING:DirectionsCriteria.EXCLUDE_FERRY- 参数:
exclude- a string matching one of theDirectionsCriteria.ExcludeCriteriaexclusions- 返回:
- this builder for chaining options together
-
approaches
Indicates from which side of the road to approach a waypoint. AcceptsDirectionsCriteria.APPROACH_UNRESTRICTED(default) orDirectionsCriteria.APPROACH_CURB. If set toDirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints from either side of the road. If set toDirectionsCriteria.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 (;)- 返回:
- this builder for chaining options together
-
approachesList
Indicates from which side of the road to approach a waypoint. AcceptsDirectionsCriteria.APPROACH_UNRESTRICTED(default) orDirectionsCriteria.APPROACH_CURB. If set toDirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints from either side of the road. If set toDirectionsCriteria.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 Strings- 返回:
- this builder for chaining options together
-
waypointIndices
Indicates which input coordinates should be treated as waypoints.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 ; .
The same waypoint indices the user originally made when the request was made.RouteOptions.steps()- 参数:
waypointIndices- to be used as waypoints- 返回:
- this builder for chaining options together
-
waypointIndicesList
Indicates which input coordinates should be treated as waypoints.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'.
The same waypoint indices the user originally made when the request was made.RouteOptions.steps()- 参数:
indices- a list to be used as waypoints- 返回:
- this builder for chaining options together
-
waypointNames
A semicolon-separated list of custom names for entries in the list ofRouteOptions.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 withsteps(Boolean)= true.- 参数:
waypointNames- unrestricted, curb or omitted (;)- 返回:
- this builder for chaining options together
-
waypointNamesList
A semicolon-separated list of custom names for entries in the list ofRouteOptions.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 withsteps(Boolean)= true.- 参数:
waypointNames- a list of Strings- 返回:
- this builder for chaining options together
-
waypointTargets
A semicolon-separated list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates. If this parameter is provided, the Directions API will compute the side of the street, left or right, for each target based on the waypoint_targets and the driving direction. The maneuver.modifier, banner and voice instructions will be updated with the computed side of street. The number of waypoint targets must be the same as the number of coordinates, but you can skip a coordinate pair and show its position in the list with the ; separator. Must be used withsteps(Boolean)= true. The same waypoint targets the user originally made when the request was made.- 参数:
waypointTargets- list of coordinate pairs for drop-off locations (;)- 返回:
- this builder for chaining options together
-
waypointTargetsList
public RouteOptions.Builder waypointTargetsList(@NonNull List<ai.nextbillion.kits.geojson.Point> waypointTargets) A list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates. If this parameter is provided, the Directions API will compute the side of the street, left or right, for each target based on the waypoint_targets and the driving direction. The maneuver.modifier, banner and voice instructions will be updated with the computed side of street. The number of waypoint targets must be the same as the number of coordinates, but you can skip a coordinate pair and show its position in the list with the null value. Must be used withsteps(Boolean)= true. The same waypoint targets the user originally made when the request was made.- 参数:
waypointTargets- list of Points for drop-off locations- 返回:
- this builder for chaining options together
-
walkingOptions
To be used to specify settings for use with the walking profile.- 参数:
walkingOptions- options to use for walking profile- 返回:
- this builder for chaining options together
-
snappingClosures
A semicolon-separated list of booleans affecting snapping of waypoint locations to road segments. If true, road segments closed due to live-traffic closures will be considered for snapping. If false, they will not be considered for snapping. If provided, the number of snappingClosures must be the same as the number of coordinates. You can skip a coordinate and show its position in the list with the ; separator. If unspecified, this parameter defaults to false. Must be used withDirectionsCriteria.PROFILE_DRIVING_TRAFFIC- 参数:
snappingClosures- a semicolon-separated list of booleans- 返回:
- this builder for chaining options together
-
snappingClosures
A list of booleans affecting snapping of waypoint locations to road segments. If true, road segments closed due to live-traffic closures will be considered for snapping. If false, they will not be considered for snapping. If provided, the number of snappingClosures must be the same as the number of coordinates. You can skip a coordinate and show its position in the list with null value. If unspecified, this parameter defaults to false. Must be used withDirectionsCriteria.PROFILE_DRIVING_TRAFFIC- 参数:
snappingClosures- a list of booleans- 返回:
- this builder for chaining options together
-
build
Builds a new instance of theRouteOptionsobject.- 返回:
- a new
RouteOptionsinstance
-