From 7849d4781e78695048acc0bcf64e430bb0c9bec5 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 13 Oct 2023 09:22:18 -0500 Subject: [PATCH] Correct `NavigationMatchOptions` congestion level in cycling profile (#4563) Correct the `.numericCongestionLevel` attribute to `.congestionLevel` when using the cycling profile. This is the same as https://github.com/mapbox/mapbox-navigation-ios/issues/3495 (https://github.com/mapbox/mapbox-navigation-ios/pull/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 --- Sources/MapboxCoreNavigation/NavigationRouteOptions.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/MapboxCoreNavigation/NavigationRouteOptions.swift b/Sources/MapboxCoreNavigation/NavigationRouteOptions.swift index 4fc6387a632..c763d86373c 100644 --- a/Sources/MapboxCoreNavigation/NavigationRouteOptions.swift +++ b/Sources/MapboxCoreNavigation/NavigationRouteOptions.swift @@ -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) }