RouteLegProgress
open class RouteLegProgress : Codable
RouteLegProgress
stores the user’s progress along a route leg.
-
Returns the current
RouteLeg
.Declaration
Swift
public let leg: RouteLeg
-
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.Declaration
Swift
public func stepBefore(_ step: RouteStep) -> RouteStep?
-
Returns the
RouteStep
after a given step. Returnsnil
if there is not a step after.Declaration
Swift
public func stepAfter(_ step: RouteStep) -> RouteStep?
-
Returns the
RouteStep
before the current step.If there is no
priorStep
, nil is returned.Declaration
Swift
public var priorStep: RouteStep? { get }
-
Returns the current
RouteStep
for the leg the user is on.Declaration
Swift
public var currentStep: RouteStep { get }
-
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 }
-
Return bool whether step provided is the current
RouteStep
the user is on.Declaration
Swift
public func isCurrentStep(_ step: RouteStep) -> Bool
-
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.