Package es.situm.sdk.navigation
Class NavigationRequest.Builder
java.lang.Object
es.situm.sdk.navigation.NavigationRequest.Builder
- Enclosing class:
- NavigationRequest
NavigationState builder static inner class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns aNavigationStatewith the previously set parameters.distanceToChangeFloorThreshold(double distanceToChangeFloorThreshold) Sets the distance threshold from when a floor change is considered reached.distanceToChangeIndicationThreshold(double distanceToChangeIndicationThreshold) Sets the distance threshold from when the next indication is considered reached.distanceToGoalThreshold(double distanceToGoalThreshold) Sets the distance threshold from when the goal is considered reached.distanceToIgnoreFirstIndication(double distanceToIgnoreFirstIndication) Sets the maximum distance to ignore the first indication when navigating a route.ignoreLowQualityLocations(boolean ignoreLowQualityLocations) Set if low quality locations should be ignored.indicationsInterval(long millis) Sets the time to wait between indications.outsideRouteThreshold(double outsideRouteThreshold) Sets theoutsideRouteThreshold.roundIndicationsStep(int meters) Sets the step that will be used to round indications distance.Sets theRoutewhose progress is going to be updated.timeToFirstIndication(long millis) Sets the time to wait until the first indication is returned.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).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
route
Sets theRoutewhose progress is going to be updated.- Parameters:
route- therouteto set, so that the methods can be chained together.- Returns:
- a reference to this Builder
-
distanceToChangeFloorThreshold
@NonNull public NavigationRequest.Builder distanceToChangeFloorThreshold(@FloatRange(from=0.0) double distanceToChangeFloorThreshold) Sets the distance threshold from when a floor change is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_CHANGE_FLOOR}.- Parameters:
distanceToChangeFloorThreshold- thedistanceToChangeFloorThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToChangeIndicationThreshold
@NonNull public NavigationRequest.Builder distanceToChangeIndicationThreshold(@FloatRange(from=0.0) double distanceToChangeIndicationThreshold) Sets the distance threshold from when the next indication is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_TO_CHANGE_INDICATION}.- Parameters:
distanceToChangeIndicationThreshold- thedistanceToChangeIndicationThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
outsideRouteThreshold
@NonNull public NavigationRequest.Builder outsideRouteThreshold(@FloatRange(from=0.0) double outsideRouteThreshold) Sets theoutsideRouteThreshold. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.- Parameters:
outsideRouteThreshold- theoutsideRouteThresholdto set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToIgnoreFirstIndication
@NonNull public NavigationRequest.Builder distanceToIgnoreFirstIndication(@FloatRange(from=0.0) double distanceToIgnoreFirstIndication) Sets the maximum distance to ignore the first indication when navigating a route. This will allow to inform the user of the next turn some metres before reaching the intersection. Default value is {NavigationRequest.DEFAULT_DISTANCE_TO_IGNORE_FIRST_INDICATION}.- Parameters:
distanceToIgnoreFirstIndication- thedistanceToIgnoreFirstIndicationto set- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
distanceToGoalThreshold
@NonNull public NavigationRequest.Builder distanceToGoalThreshold(@FloatRange(from=0.0) double distanceToGoalThreshold) Sets the distance threshold from when the goal is considered reached. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.- Parameters:
distanceToGoalThreshold- thedistanceToGoalThresholdto set, in meters.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
indicationsInterval
Sets the time to wait between indications. Default value isNavigationRequest.DEFAULT_INDICATIONS_INTERVALmilliseconds. 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 theRouteStepin theNavigationProgress -
timeToFirstIndication
Sets the time to wait until the first indication is returned. This is recommended when positioning is started along with navigation, in order to provide more accurate and stable indications. Default value isNavigationRequest.DEFAULT_TIME_TO_FIRST_INDICATIONmilliseconds. 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 returnIndication.CALCULATINGduring that time. -
roundIndicationsStep
Sets the step that will be used to round indications distance. For example, with a step of 5, a 13 meters indication will be transformed into a 15 meters indication. Default value isNavigationRequest.DEFAULT_ROUND_INDICATION_STEPmeters. With a value of 0 it won't round indications distance. -
timeToIgnoreUnexpectedFloorChanges
@NonNull public NavigationRequest.Builder timeToIgnoreUnexpectedFloorChanges(@IntRange(from=0L) 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). Default value isNavigationRequest.DEFAULT_TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGESWith a value of 0 it won't ignore any location. -
ignoreLowQualityLocations
@NonNull public NavigationRequest.Builder ignoreLowQualityLocations(boolean ignoreLowQualityLocations) Set if low quality locations should be ignored. With this option enabled, Location updates withLocation.Quality.LOWLocation.Qualitywill 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, aNavigationProgresswon'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 isNavigationRequest.DEFAULT_IGNORE_LOW_QUALITY_LOCATIONS. -
build
Returns aNavigationStatewith the previously set parameters.- Returns:
NavigationState- Throws:
IllegalArgumentException
-