public abstract class RouteStepProgress extends Object
The latest route step progress object can be obtained through either the ProgressChangeListener
or the MilestoneEventListener
callbacks.
Note that the route step progress object's immutable.
Constructor and Description |
---|
RouteStepProgress() |
Modifier and Type | Method and Description |
---|---|
static com.mapbox.services.android.navigation.v5.routeprogress.RouteStepProgress.Builder |
builder() |
abstract com.mapbox.api.directions.v5.models.StepIntersection |
currentIntersection()
The current intersection that has been passed along the route.
|
abstract double |
distanceRemaining()
Total distance in meters from user to end of step.
|
abstract double |
distanceTraveled()
Returns distance user has traveled along current step in unit meters.
|
abstract double |
durationRemaining()
Provides the duration remaining in seconds till the user reaches the end of the current step.
|
abstract float |
fractionTraveled()
Get the fraction traveled along the current step, this is a float value between 0 and 1 and
isn't guaranteed to reach 1 before the user reaches the next step (if another step exist in route).
|
abstract List<Pair<com.mapbox.api.directions.v5.models.StepIntersection,Double>> |
intersectionDistancesAlongStep()
Provides a list of pairs containing two distances, in meters, along the route.
|
abstract List<com.mapbox.api.directions.v5.models.StepIntersection> |
intersections()
A collection of all the current steps intersections and the next steps maneuver location
(if one exist).
|
abstract com.mapbox.api.directions.v5.models.StepIntersection |
upcomingIntersection()
The intersection being traveled towards on the route.
|
public static com.mapbox.services.android.navigation.v5.routeprogress.RouteStepProgress.Builder builder()
public abstract double distanceRemaining()
public abstract double distanceTraveled()
public abstract float fractionTraveled()
public abstract double durationRemaining()
long
value representing the duration remaining till end of step, in unit seconds.public abstract List<com.mapbox.api.directions.v5.models.StepIntersection> intersections()
StepIntersection
s which may include the next steps maneuver
intersection if it existpublic abstract com.mapbox.api.directions.v5.models.StepIntersection currentIntersection()
An intersection is considered a current intersection once passed through and will remain so until a different intersection is passed through.
@Nullable public abstract com.mapbox.api.directions.v5.models.StepIntersection upcomingIntersection()
Will be null if the upcoming step is null (last step of the leg).
public abstract List<Pair<com.mapbox.api.directions.v5.models.StepIntersection,Double>> intersectionDistancesAlongStep()
The first distance in the pair is the tunnel entrance along the step geometry. The second distance is the tunnel exit along the step geometry.
© 2019 Mapbox. All rights reserved.