public abstract class RouteLegProgress extends Object
RouteProgress
.
The latest route leg progress object can be obtained through either the ProgressChangeListener
or the MilestoneEventListener
callbacks.
Note that the route leg progress object's immutable.
Modifier and Type | Class and Description |
---|---|
static class |
RouteLegProgress.Builder |
Constructor and Description |
---|
RouteLegProgress() |
Modifier and Type | Method and Description |
---|---|
static RouteLegProgress.Builder |
builder() |
abstract CurrentLegAnnotation |
currentLegAnnotation()
Provides the current annotation data for a leg segment determined by
the distance traveled along the route.
|
com.mapbox.api.directions.v5.models.LegStep |
currentStep()
Returns the current step the user is traversing along.
|
abstract List<com.mapbox.geojson.Point> |
currentStepPoints()
Provides a list of points that represent the current step
step geometry.
|
abstract RouteStepProgress |
currentStepProgress()
Gives a
RouteStepProgress object with information about the particular step the user
is currently on. |
abstract double |
distanceRemaining()
Provides the duration remaining in seconds till the user reaches the end of the route.
|
double |
distanceTraveled()
Total distance traveled in meters along current leg.
|
abstract double |
durationRemaining()
Provides the duration remaining in seconds till the user reaches the end of the current step.
|
com.mapbox.api.directions.v5.models.LegStep |
followOnStep()
This will return the
LegStep two steps ahead of the current step the user's on. |
float |
fractionTraveled()
Get the fraction traveled along the current leg, this is a float value between 0 and 1 and
isn't guaranteed to reach 1 before the user reaches the next waypoint.
|
com.mapbox.api.directions.v5.models.LegStep |
previousStep()
Get the previous step the user traversed along, if the user is still on the first step, this
will return null.
|
abstract int |
stepIndex()
Index representing the current step the user is on.
|
com.mapbox.api.directions.v5.models.LegStep |
upComingStep()
Get the next/upcoming step immediately after the current step.
|
abstract List<com.mapbox.geojson.Point> |
upcomingStepPoints()
Provides a list of points that represent the upcoming step
step geometry.
|
public abstract int stepIndex()
public double distanceTraveled()
public abstract double distanceRemaining()
public abstract double durationRemaining()
public float fractionTraveled()
@Nullable public com.mapbox.api.directions.v5.models.LegStep previousStep()
LegStep
representing the previous step the user was on, if still on first
step in route, returns null@NonNull public com.mapbox.api.directions.v5.models.LegStep currentStep()
LegStep
representing the step the user is currently on@Nullable public com.mapbox.api.directions.v5.models.LegStep upComingStep()
LegStep
representing the next step the user will be on.@Nullable public com.mapbox.api.directions.v5.models.LegStep followOnStep()
LegStep
two steps ahead of the current step the user's on. If the
user's current step is within 2 steps of their final destination this will return null.LegStep
after the upComingStep()
public abstract RouteStepProgress currentStepProgress()
RouteStepProgress
object with information about the particular step the user
is currently on.RouteStepProgress
objectpublic abstract List<com.mapbox.geojson.Point> currentStepPoints()
@Nullable public abstract List<com.mapbox.geojson.Point> upcomingStepPoints()
@Nullable public abstract CurrentLegAnnotation currentLegAnnotation()
This object will only be present when a DirectionsRoute
requested with DirectionsCriteria.ANNOTATION_DISTANCE
.
This will be provided by default with NavigationRoute.builder(Context)
.
public static RouteLegProgress.Builder builder()
© 2019 Mapbox. All rights reserved.