public static final class NavigationRequest.Builder
extends java.lang.Object
NavigationState builder static inner class.| Constructor and Description |
|---|
Builder() |
Builder(NavigationRequest copy) |
| Modifier and Type | Method and Description |
|---|---|
NavigationRequest |
build()
Returns a
NavigationState with the previously set parameters. |
NavigationRequest.Builder |
distanceToChangeFloorThreshold(double distanceToChangeFloorThreshold)
Sets the distance threshold from when a floor change is considered reached.
|
NavigationRequest.Builder |
distanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold)
Sets the distance threshold from when the next indication is considered reached.
|
NavigationRequest.Builder |
distanceToGoalThreshold(double distanceToGoalThreshold)
Sets the distance threshold from when the goal is considered reached.
|
NavigationRequest.Builder |
distanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication)
Sets the maximum distance to ignore the first indication when navigating a route.
|
NavigationRequest.Builder |
ignoreLowQualityLocations(boolean ignoreLowQualityLocations)
Set if low quality locations should be ignored.
|
NavigationRequest.Builder |
indicationsInterval(long millis)
Sets the time to wait between indications.
|
NavigationRequest.Builder |
outsideRouteThreshold(double outsideRouteThreshold)
Sets the
outsideRouteThreshold. |
NavigationRequest.Builder |
roundIndicationsStep(int meters)
Sets the step that will be used to round indications distance.
|
NavigationRequest.Builder |
route(Route route)
Sets the
Route whose progress is going to be updated. |
NavigationRequest.Builder |
timeToFirstIndication(long millis)
Sets the time to wait until the first indication is returned.
|
NavigationRequest.Builder |
timeToIgnoreUnexpectedFloorChanges(int millis)
Sets the time (in millis) to ignore the locations received during navigation, when the
next indication is a floor change, if the locations are in a wrong floor (not in origin
or destination floors).
|
public Builder()
public Builder(NavigationRequest copy)
public NavigationRequest.Builder route(Route route)
Route whose progress is going to be updated.route - the route to set, so that the methods can be chained together.public NavigationRequest.Builder distanceToChangeFloorThreshold(double distanceToChangeFloorThreshold)
NavigationRequest.DEFAULT_DISTANCE_CHANGE_FLOOR}.distanceToChangeFloorThreshold - the distanceToChangeFloorThreshold to set, in meters.public NavigationRequest.Builder distanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold)
NavigationRequest.DEFAULT_DISTANCE_TO_CHANGE_INDICATION}.distanceToChangeIndicationThreshold - the distanceToChangeIndicationThreshold to set, in meters.public NavigationRequest.Builder outsideRouteThreshold(double outsideRouteThreshold)
outsideRouteThreshold.
Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.outsideRouteThreshold - the outsideRouteThreshold to setpublic NavigationRequest.Builder distanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication)
NavigationRequest.DEFAULT_DISTANCE_TO_IGNORE_FIRST_INDICATION}.distanceToIgnoreFirstIndication - the distanceToIgnoreFirstIndication to setpublic NavigationRequest.Builder distanceToGoalThreshold(double distanceToGoalThreshold)
NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.distanceToGoalThreshold - the distanceToGoalThreshold to set, in meters.public NavigationRequest.Builder indicationsInterval(long millis)
NavigationRequest.DEFAULT_INDICATIONS_INTERVAL milliseconds.
With a value of 0 a new indication will be returned every time a new position is computed.
If the value is different than 0 the indications may not be synchronized with the RouteStep
in the NavigationProgresspublic NavigationRequest.Builder timeToFirstIndication(long millis)
NavigationRequest.DEFAULT_TIME_TO_FIRST_INDICATION milliseconds.
With a value of 0 the first indication will be returned as soon as it is calculated.
If a non zero value is used it will return Indication.CALCULATING during that time.public NavigationRequest.Builder roundIndicationsStep(int meters)
NavigationRequest.DEFAULT_ROUND_INDICATION_STEP meters.
With a value of 0 it won't round indications distance.public NavigationRequest.Builder timeToIgnoreUnexpectedFloorChanges(int millis)
NavigationRequest.DEFAULT_TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES
With a value of 0 it won't ignore any location.public NavigationRequest.Builder ignoreLowQualityLocations(boolean ignoreLowQualityLocations)
Location.Quality#LOW Location.Quality
will be ignored for navigation. This will improve the feasibility of the indications,
specially on start and during a floor change, but navigation could freeze
if too many low quality locations are received.
When starting the navigation, a NavigationProgress won't be sent until a high quality location is received.
You should manage this case in your application by showing a "calculating" dialog or similar.
During navigation, if low quality locations are received, no NavigationProgress will be sent until a high quality location is received.
Default value is NavigationRequest.DEFAULT_IGNORE_LOW_QUALITY_LOCATIONS.public NavigationRequest build() throws java.lang.IllegalArgumentException
NavigationState with the previously set parameters.NavigationStatejava.lang.IllegalArgumentException