Skip to content

Commit

Permalink
Correct NavigationMatchOptions congestion level in cycling profile (#…
Browse files Browse the repository at this point in the history
…4563)

Correct the `.numericCongestionLevel` attribute to `.congestionLevel` when using the cycling profile. This is the same as #3495 (#3496) but for `NavigationMatchOptions` instead of `NavigationRouteOptions`.

https://github.com/mapbox/mapbox-navigation-ios/blob/ff4873f77bd91505820e6027f1a4a43efc4a7a3d/Sources/MapboxCoreNavigation/NavigationRouteOptions.swift#L28-L34

Signed-off-by: Matt Robinson <[email protected]>
  • Loading branch information
mattrobmattrob authored Oct 13, 2023
1 parent ff4873f commit 7849d47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/MapboxCoreNavigation/NavigationRouteOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ open class NavigationMatchOptions: MatchOptions, OptimizedForNavigation {
},
profileIdentifier: profileIdentifier,
queryItems: queryItems)
attributeOptions = [.numericCongestionLevel, .expectedTravelTime]
attributeOptions = [.expectedTravelTime]
if profileIdentifier == .cycling {
// https://github.com/mapbox/mapbox-navigation-ios/issues/3495
attributeOptions.update(with: .congestionLevel)
} else {
attributeOptions.update(with: .numericCongestionLevel)
}
if profileIdentifier == .automobile || profileIdentifier == .automobileAvoidingTraffic {
attributeOptions.insert(.maximumSpeedLimit)
}
Expand Down

0 comments on commit 7849d47

Please sign in to comment.