RouteLegProgress
open class RouteLegProgress : Codable
RouteLegProgress
stores the user’s progress along a route leg.
-
Total distance traveled in meters along current leg.
Declaration
Swift
public var distanceTraveled: CLLocationDistance { get }
-
Duration remaining in seconds on current leg.
Declaration
Swift
public var durationRemaining: TimeInterval { get }
-
Distance remaining on the current leg.
Declaration
Swift
public var distanceRemaining: CLLocationDistance { get }
-
Number between 0 and 1 representing how far along the current leg the user has traveled.
Declaration
Swift
public var fractionTraveled: Double { get }
-
Declaration
Swift
public var userHasArrivedAtWaypoint: Bool
-
Index representing the current step.
Declaration
Swift
public var stepIndex: Int { get set }
-
The remaining steps for user to complete.
Declaration
Swift
public var remainingSteps: [RouteStep] { get }
-
Returns the
RouteStep
before a given step. Returnsnil
if there is no step prior. -
Returns the
RouteStep
after a given step. Returnsnil
if there is not a step after. -
Declaration
Swift
public var upcomingStep: RouteStep? { get }
-
Returns step 2 steps ahead.
If there is no
followOnStep
, nil is returned.Declaration
Swift
public var followOnStep: RouteStep? { get }
-
Returns the progress along the current
RouteStep
.Declaration
Swift
public var currentStepProgress: RouteStepProgress
-
Returns the SpeedLimit for the current position along the route. Returns SpeedLimit.invalid if the speed limit is unknown or missing.
The maximum speed may be an advisory speed limit for segments where legal limits are not posted, such as highway entrance and exit ramps. If the speed limit along a particular segment is unknown, it is set to
nil
. If the speed is unregulated along the segment, such as on the German Autobahn system, it is represented by a measurement whose value isDouble.infinity
.Speed limit data is available in a number of countries and territories worldwide.
Declaration
Swift
public var currentSpeedLimit: Measurement<UnitSpeed>? { get }
-
Index relative to leg shape, representing the point the user is currently located at.
Declaration
Swift
public internal(set) var shapeIndex: Int { get }
-
Intializes a new
RouteLegProgress
.Declaration
Swift
public init(leg: RouteLeg, stepIndex: Int = 0, spokenInstructionIndex: Int = 0, shapeIndex: Int = 0, intersectionIndex: Int = 0)
Parameters
leg
Leg on a
Route
.stepIndex
Current step the user is on.
shapeIndex
Index relative to leg shape, representing the point the user is currently located at.