RouteLegProgress

class RouteLegProgress

This is a progress object specific to the current leg the user is on. If there is only one leg in the directions route, much of this information will be identical to the parent RouteProgress.

The latest route leg progress object can be obtained through the com.mapbox.navigation.core.trip.session.RouteProgressObserver. Note that the route leg progress object's immutable.

Parameters

legIndex

Index representing the current leg the user is on. If the directions route currently in use contains more then two waypoints, the route is likely to have multiple legs representing the distance between the two points.

routeLeg

RouteLeg geometry

distanceTraveled

Total distance traveled in meters along current leg

distanceRemaining

The distance remaining in meters until the user reaches the end of the leg

durationRemaining

The duration remaining in seconds until the user reaches the end of the current step

fractionTraveled

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

currentStepProgress

RouteStepProgress object with information about the particular step the user is currently on

upcomingStep

Next/upcoming step immediately after the current step. If the user is on the last step on the last leg, this will return null since a next step doesn't exist

Types

Builder
Link copied to clipboard
class Builder
Builder of RouteLegProgress.

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Regenerate whenever a change is made
hashCode
Link copied to clipboard
open override fun hashCode(): Int
Regenerate whenever a change is made
toBuilder
Link copied to clipboard
fun toBuilder(): RouteLegProgress.Builder
toString
Link copied to clipboard
open override fun toString(): String
Returns a string representation of the object.

Properties

currentStepProgress
Link copied to clipboard
val currentStepProgress: RouteStepProgress?
RouteStepProgress object with information about the particular step the user is currently on
distanceRemaining
Link copied to clipboard
val distanceRemaining: Float
The distance remaining in meters until the user reaches the end of the leg
distanceTraveled
Link copied to clipboard
val distanceTraveled: Float
Total distance traveled in meters along current leg
durationRemaining
Link copied to clipboard
val durationRemaining: Double
The duration remaining in seconds until the user reaches the end of the current step
fractionTraveled
Link copied to clipboard
val fractionTraveled: Float
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
legIndex
Link copied to clipboard
val legIndex: Int
Index representing the current leg the user is on.
routeLeg
Link copied to clipboard
val routeLeg: RouteLeg?
RouteLeg geometry
upcomingStep
Link copied to clipboard
val upcomingStep: LegStep?
Next/upcoming step immediately after the current step.