RouteLegProgress
@objc(MBRouteLegProgress)
open class RouteLegProgress : NSObject
RouteLegProgress
stores the user’s progress along a route leg.
-
Returns the current
RouteLeg
.Declaration
Swift
@objc public let leg: RouteLeg
-
Index representing the current step.
Declaration
Swift
@objc public var stepIndex: Int { get set }
-
The remaining steps for user to complete.
Declaration
Swift
@objc public var remainingSteps: [RouteStep] { get }
-
Total distance traveled in meters along current leg.
Declaration
Swift
@objc public var distanceTraveled: CLLocationDistance { get }
-
Duration remaining in seconds on current leg.
Declaration
Swift
@objc public var durationRemaining: TimeInterval { get }
-
Distance remaining on the current leg.
Declaration
Swift
@objc public var distanceRemaining: CLLocationDistance { get }
-
Number between 0 and 1 representing how far along the current leg the user has traveled.
Declaration
Swift
@objc public var fractionTraveled: Double { get }
-
Returns the
RouteStep
before a given step. Returnsnil
if there is no step prior.Declaration
Swift
@objc public func stepBefore(_ step: RouteStep) -> RouteStep?
-
Returns the
RouteStep
after a given step. Returnsnil
if there is not a step after.Declaration
Swift
@objc public func stepAfter(_ step: RouteStep) -> RouteStep?
-
Returns the
RouteStep
before the current step.If there is no
priorStep
, nil is returned.Declaration
Swift
@objc public var priorStep: RouteStep? { get }
-
Returns the current
RouteStep
for the leg the user is on.Declaration
Swift
@objc public var currentStep: RouteStep { get }
-
Returns the upcoming
RouteStep
.If there is no
upcomingStep
, nil is returned.Declaration
Swift
@available(*, deprecated, renamed: "upcomingStep") @objc public var upComingStep: RouteStep? { get }
-
Returns step 2 steps ahead.
If there is no
followOnStep
, nil is returned.Declaration
Swift
@objc public var followOnStep: RouteStep? { get }
-
Return bool whether step provided is the current
RouteStep
the user is on.Declaration
Swift
@objc public func isCurrentStep(_ step: RouteStep) -> Bool
-
Returns the progress along the current
RouteStep
.Declaration
Swift
@objc public var currentStepProgress: RouteStepProgress
-
Intializes a new
RouteLegProgress
.Declaration
Swift
@objc public init(leg: RouteLeg, stepIndex: Int = 0, spokenInstructionIndex: Int = 0)
Parameters
leg
Leg on a
Route
.stepIndex
Current step the user is on.
-
Returns an array of
CLLocationCoordinate2D
of the prior, current and upcoming step geometry.Declaration
Swift
@available(*, deprecated, message: "Use RouteProgress.nearbyCoordinates") @objc public var nearbyCoordinates: [CLLocationCoordinate2D] { get }
-
Declaration
Swift
public func encode(to encoder: Encoder) throws