public abstract class RouteProgress
extends java.lang.Object
routeProgress class contains all progress information of user along the route, leg and step.
You can use this together with MapboxNavigation to obtain this object from the AlertLevelChangeListener or the ProgressChangeListener. This object is immutable and a new, updated routeProgress object will be provided with each new location update.
This is an experimental API. Experimental APIs are quickly evolving and might change or be removed in minor versions.
| Constructor and Description |
|---|
RouteProgress() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
alertUserLevel() |
static RouteProgress |
create(com.mapbox.services.api.directions.v5.models.DirectionsRoute route,
com.mapbox.services.commons.models.Position userSnappedPosition,
int legIndex,
int stepIndex,
int alertUserLevel)
Constructor for the route routeProgress information.
|
abstract RouteLegProgress |
currentLegProgress() |
int |
getAlertUserLevel()
Get the most recently provided alert level, this can and will only be one of the alert constants.
|
com.mapbox.services.api.directions.v5.models.RouteLeg |
getCurrentLeg()
Provides the current
RouteLeg the user is on. |
RouteLegProgress |
getCurrentLegProgress()
Gives a
RouteLegProgress object with information about the particular leg 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 route.
|
double |
getDurationRemaining()
Provides the duration remaining in seconds till the user reaches the end of the route.
|
float |
getFractionTraveled()
Get the fraction traveled along the current route, this is a float value between 0 and 1 and isn't guaranteed to
reach 1 before the user reaches the end of the route.
|
int |
getLegIndex()
Index representing the current leg.
|
com.mapbox.services.api.directions.v5.models.DirectionsRoute |
getRoute()
Get the route the navigation session is currently using.
|
abstract int |
legIndex() |
abstract com.mapbox.services.api.directions.v5.models.DirectionsRoute |
route() |
abstract com.mapbox.services.commons.models.Position |
userSnappedPosition() |
public abstract RouteLegProgress currentLegProgress()
public abstract com.mapbox.services.api.directions.v5.models.DirectionsRoute route()
public abstract com.mapbox.services.commons.models.Position userSnappedPosition()
public abstract int legIndex()
public abstract int alertUserLevel()
public static RouteProgress create(com.mapbox.services.api.directions.v5.models.DirectionsRoute route, com.mapbox.services.commons.models.Position userSnappedPosition, int legIndex, int stepIndex, int alertUserLevel)
route - the DirectionsRoute being used for the navigation session. When a user is
rerouted this route is updated.userSnappedPosition - the users position most recently used when creating this object.stepIndex - an integer representing the current step index the user is on.alertUserLevel - the most recently calculated alert level.public RouteLegProgress getCurrentLegProgress()
RouteLegProgress object with information about the particular leg the user is currently on.RouteLegProgress object.public int getLegIndex()
integer representing the current leg the user is on.public com.mapbox.services.api.directions.v5.models.RouteLeg getCurrentLeg()
RouteLeg the user is on.RouteLeg the user is currently on.public double getDistanceTraveled()
public double getDurationRemaining()
long value representing the duration remaining till end of route, in unit seconds.public float getFractionTraveled()
public double getDistanceRemaining()
long value representing the duration remaining till end of route, in unit seconds.public int getAlertUserLevel()
integer representing the most recent user alert level.public com.mapbox.services.api.directions.v5.models.DirectionsRoute getRoute()
DirectionsRoute currently being used for the navigation session.