diff --git a/MapboxCoreNavigation/NavigationRouteOptions.swift b/MapboxCoreNavigation/NavigationRouteOptions.swift index a14d404646..35a7093e55 100644 --- a/MapboxCoreNavigation/NavigationRouteOptions.swift +++ b/MapboxCoreNavigation/NavigationRouteOptions.swift @@ -83,10 +83,9 @@ open class NavigationMatchOptions: MatchOptions { includesSteps = true routeShapeResolution = .full shapeFormat = .polyline6 - if profileIdentifier == .walking { - attributeOptions = [.congestionLevel, .expectedTravelTime] - } else { - attributeOptions = [.congestionLevel, .expectedTravelTime, .maximumSpeedLimit] + attributeOptions = [.congestionLevel, .expectedTravelTime] + if profileIdentifier == .automobile || profileIdentifier == .automobileAvoidingTraffic { + attributeOptions.insert(.maximumSpeedLimit) } includesSpokenInstructions = true locale = Locale.nationalizedCurrent diff --git a/MapboxCoreNavigation/RouteProgress.swift b/MapboxCoreNavigation/RouteProgress.swift index 788f5a6a5c..85882d6ec2 100644 --- a/MapboxCoreNavigation/RouteProgress.swift +++ b/MapboxCoreNavigation/RouteProgress.swift @@ -258,7 +258,7 @@ open class RouteProgress: NSObject { Returns the SpeedLimit for the current position along the route. Returns SpeedLimit.invalid if the speed limit is unknown or missing. */ public var currentSpeedLimit: SpeedLimit { - + guard legIndex < positionedSpeedLimitsByStep.count, currentLegProgress.stepIndex < positionedSpeedLimitsByStep[legIndex].count else { return .invalid } let speedLimits = positionedSpeedLimitsByStep[legIndex][currentLegProgress.stepIndex] let lastSpeedLimitTuple = speedLimits.last { $0.1 <= currentLegProgress.currentStepProgress.distanceTraveled } if let lastSpeedLimitTuple = lastSpeedLimitTuple {