RouteProgress
@objc(MBRouteProgress)
open class RouteProgress : NSObject
RouteProgress
stores the user’s progress along a route.
-
Returns the current
Route
.Declaration
Swift
@objc public let route: Route
-
Index representing current
RouteLeg
.Declaration
Swift
@objc public var legIndex: Int { get set }
-
If waypoints are provided in the
Route
, this will contain which leg the user is on.Declaration
Swift
@objc public var currentLeg: RouteLeg { get }
-
Returns true if
currentLeg
is the last leg.Declaration
Swift
public var isFinalLeg: Bool { get }
-
Total distance traveled by user along all legs.
Declaration
Swift
@objc public var distanceTraveled: CLLocationDistance { get }
-
Total seconds remaining on all legs.
Declaration
Swift
@objc public var durationRemaining: TimeInterval { get }
-
Number between 0 and 1 representing how far along the
Route
the user has traveled.Declaration
Swift
@objc public var fractionTraveled: Double { get }
-
Total distance remaining in meters along route.
Declaration
Swift
@objc public var distanceRemaining: CLLocationDistance { get }
-
Number of waypoints remaining on the current route.
Declaration
Swift
@objc public var remainingWaypoints: [Waypoint] { get }
-
Returns the progress along the current
RouteLeg
.Declaration
Swift
@objc public var currentLegProgress: RouteLegProgress!
-
Tuple containing a
CongestionLevel
and a correspondingTimeInterval
representing the expected travel time for this segment.Declaration
Swift
public typealias TimedCongestionLevel = (CongestionLevel, TimeInterval)
-
If the route contains both
segmentCongestionLevels
andexpectedSegmentTravelTimes
, this property is set to a deeply nested array ofTimeCongestionLevels
per segment per step per leg.Declaration
Swift
public var congestionTravelTimesSegmentsByStep: [[[RouteProgress.TimedCongestionLevel]]]
-
An dictionary containing a
TimeInterval
total perCongestionLevel
. OnlyCongestionLevel
founnd on that step will present. Broken up by leg and then step.Declaration
Swift
public var congestionTimesPerStep: [[[CongestionLevel : TimeInterval]]]
-
Intializes a new
RouteProgress
.Declaration
Swift
@objc public init(route: Route, legIndex: Int = 0, spokenInstructionIndex: Int = 0)
Parameters
route
The route to follow.
legIndex
Zero-based index indicating the current leg the user is on.