Class NavigationRequest.Builder

  • Enclosing class:
    NavigationRequest

    public static final class NavigationRequest.Builder
    extends Object
    NavigationState builder static inner class.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • route

        @NonNull
        public NavigationRequest.Builder route​(@NonNull
                                               Route route)
        Sets the Route whose progress is going to be updated.
        Parameters:
        route - the route to 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 - the distanceToChangeFloorThreshold to 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 - the distanceToChangeIndicationThreshold to 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 the outsideRouteThreshold. Default value is {NavigationRequest.DEFAULT_DISTANCE_THRESHOLD}.
        Parameters:
        outsideRouteThreshold - the outsideRouteThreshold to 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 - the distanceToIgnoreFirstIndication to 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 - the distanceToGoalThreshold to set, in meters.
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • timeToFirstIndication

        @NonNull
        public NavigationRequest.Builder timeToFirstIndication​(@IntRange(from=0L)
                                                               long millis)
        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 is 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.
      • roundIndicationsStep

        @NonNull
        public NavigationRequest.Builder roundIndicationsStep​(@IntRange(from=0L)
                                                              int meters)
        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 is NavigationRequest.DEFAULT_ROUND_INDICATION_STEP meters. 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 is NavigationRequest.DEFAULT_TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES With 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 with 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.