public abstract class RouteProgress extends Object
The latest route progress object can be obtained through either the ProgressChangeListener
or the MilestoneEventListener
callbacks.
Note that the route progress object's immutable.
Modifier and Type | Class and Description |
---|---|
static class |
RouteProgress.Builder |
Constructor and Description |
---|
RouteProgress() |
Modifier and Type | Method and Description |
---|---|
abstract com.mapbox.navigator.BannerInstruction |
bannerInstruction()
Current banner instruction.
|
static RouteProgress.Builder |
builder() |
com.mapbox.api.directions.v5.models.RouteLeg |
currentLeg()
Provides the current
RouteLeg the user is on. |
abstract RouteLegProgress |
currentLegProgress()
Gives a
RouteLegProgress object with information about the particular leg the user is
currently on. |
abstract RouteProgressState |
currentState()
Returns the current state of progress along the route.
|
abstract List<com.mapbox.geojson.Point> |
currentStepPoints()
Provides a list of points that represent the current step
step geometry.
|
abstract com.mapbox.api.directions.v5.models.DirectionsRoute |
directionsRoute()
Get the route the navigation session is currently using.
|
abstract double |
distanceRemaining()
Provides the distance remaining in meters till the user reaches the end of the route.
|
double |
distanceTraveled()
Total distance traveled in meters along route.
|
double |
durationRemaining()
Provides the duration remaining in seconds till the user reaches the end of the route.
|
float |
fractionTraveled()
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.
|
abstract boolean |
inTunnel()
Returns whether or not the location updates are
considered in a tunnel along the route.
|
abstract int |
legIndex()
Index representing the current leg the user is on.
|
int |
remainingWaypoints()
Number of waypoints remaining on the current route.
|
abstract com.mapbox.geojson.Geometry |
routeGeometryWithBuffer()
Returns the current
DirectionsRoute geometry with a buffer
that encompasses visible tile surface are while navigating. |
abstract RouteProgress.Builder |
toBuilder() |
abstract List<com.mapbox.geojson.Point> |
upcomingStepPoints()
Provides a list of points that represent the upcoming step
step geometry.
|
abstract com.mapbox.navigator.VoiceInstruction |
voiceInstruction()
Current voice instruction.
|
public abstract com.mapbox.api.directions.v5.models.DirectionsRoute directionsRoute()
MapboxNavigation.startNavigation(DirectionsRoute)
.DirectionsRoute
currently being used for the navigation sessionpublic abstract int legIndex()
@NonNull public com.mapbox.api.directions.v5.models.RouteLeg currentLeg()
RouteLeg
the user is on.RouteLeg
the user is currently onpublic double distanceTraveled()
public double durationRemaining()
long
value representing the duration remaining till end of route, in unit
secondspublic float fractionTraveled()
public abstract double distanceRemaining()
long
value representing the distance remaining till end of route, in unit meterspublic int remainingWaypoints()
public abstract RouteLegProgress currentLegProgress()
RouteLegProgress
object with information about the particular leg the user is
currently on.RouteLegProgress
objectpublic abstract List<com.mapbox.geojson.Point> currentStepPoints()
@Nullable public abstract List<com.mapbox.geojson.Point> upcomingStepPoints()
public abstract boolean inTunnel()
@Nullable public abstract com.mapbox.navigator.VoiceInstruction voiceInstruction()
@Nullable public abstract com.mapbox.navigator.BannerInstruction bannerInstruction()
@Nullable public abstract RouteProgressState currentState()
@Nullable public abstract com.mapbox.geojson.Geometry routeGeometryWithBuffer()
DirectionsRoute
geometry with a buffer
that encompasses visible tile surface are while navigating.
This Geometry
is ideal for offline downloads of map or routing tile
data.
public abstract RouteProgress.Builder toBuilder()
public static RouteProgress.Builder builder()
© 2019 Mapbox. All rights reserved.