public abstract class RouteLegProgress
extends java.lang.Object
| Constructor and Description |
|---|
RouteLegProgress() |
| Modifier and Type | Method and Description |
|---|---|
static RouteLegProgress |
create(com.mapbox.services.api.directions.v5.models.RouteLeg routeLeg,
int stepIndex,
com.mapbox.services.commons.models.Position userSnappedPosition)
Constructor for the route leg routeProgress information.
|
abstract RouteStepProgress |
currentStepProgress() |
com.mapbox.services.api.directions.v5.models.LegStep |
getCurrentStep()
Returns the current step the user is traversing along.
|
RouteStepProgress |
getCurrentStepProgress()
Gives a
RouteStepProgress object with information about the particular step the user is currently on. |
double |
getDistanceRemaining()
Provides the duration remaining in seconds till the user reaches the end of the route.
|
double |
getDistanceTraveled()
Total distance traveled in meters along current leg.
|
double |
getDurationRemaining()
Provides the duration remaining in seconds till the user reaches the end of the current step.
|
float |
getFractionTraveled()
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 leg (if another leg exist in route).
|
com.mapbox.services.api.directions.v5.models.LegStep |
getPreviousStep()
Get the previous step the user traversed along, if the user is still on the first step, this will return null.
|
int |
getStepIndex()
Index representing the current step.
|
com.mapbox.services.api.directions.v5.models.LegStep |
getUpComingStep()
Get the next/upcoming step immediately after the current step.
|
abstract com.mapbox.services.api.directions.v5.models.RouteLeg |
routeLeg() |
abstract int |
stepIndex() |
abstract com.mapbox.services.commons.models.Position |
userSnappedPosition() |
public abstract com.mapbox.services.api.directions.v5.models.RouteLeg routeLeg()
public abstract int stepIndex()
public abstract com.mapbox.services.commons.models.Position userSnappedPosition()
public abstract RouteStepProgress currentStepProgress()
public static RouteLegProgress create(@NonNull com.mapbox.services.api.directions.v5.models.RouteLeg routeLeg, int stepIndex, @NonNull com.mapbox.services.commons.models.Position userSnappedPosition)
routeLeg - The current RouteLeg the user is traversing along.stepIndex - The current step index the user is on.userSnappedPosition - the users snapped location when routeProgress was last updated.public RouteStepProgress getCurrentStepProgress()
RouteStepProgress object with information about the particular step the user is currently on.RouteStepProgress object.public int getStepIndex()
integer representing the current step the user is on.public double getDistanceTraveled()
public double getDistanceRemaining()
long value representing the duration remaining till end of route, in unit seconds.public double getDurationRemaining()
long value representing the duration remaining till end of step, in unit seconds.public float getFractionTraveled()
public com.mapbox.services.api.directions.v5.models.LegStep getPreviousStep()
LegStep representing the previous step the user was on, if still on first step in route, returns
null.public com.mapbox.services.api.directions.v5.models.LegStep getCurrentStep()
LegStep representing the step the user is currently on.public com.mapbox.services.api.directions.v5.models.LegStep getUpComingStep()
LegStep representing the next step the user will be on.