[!IMPORTANT] A bug in the SDK's offline data management causes untracked data to accumulate instead of being removed under specific conditions. This leads to uncontrolled storage growth, potentially degrading system performance or causing complete unusability if disk space is exhausted. The required version for upgrade is 3.18.3, 3.19.1, 3.20.1 or any version from 3.21.0 onward.
MapboxMaps.MapView is now initialized by NavigationMapView using MapboxMaps.MapInitOptions(locationDataModel:). This passes location and heading providers during initialization, rather than overriding them afterwards using MapboxMaps.MapView.location.override(locationProvider:headingProvider:). This prevents MapView from creating a redundant MapboxMaps.AppleLocationProvider (which is unused by NavigationMapView and the Navigation SDK).NavigationViewController.NavigationMapView.stop() was called.RouteVoiceController.init(routeProgressing:rerouteStarted:fasterRouteSet:speechSynthesizer:) in favor of the new RouteVoiceController.init(routeProgressing:rerouteSoundTrigger:speechSynthesizer:).AVAudioPlayer within the MapboxSpeechSynthesizer are now triggered on a background thread. This change minimizes the risk of the application hanging during voice instruction playback.DirectionsOptions, IsochroneOptions, and MatrixOptions - an error is logged when duplicates are found.AVAudioPlayer within the MapboxSpeechSynthesizer are now triggered on a background thread. This change minimizes the risk of the application hanging during voice instruction playback.CongestionColorsConfiguration.displaySoftGradientForTraffic to customize if the color transition between traffic congestion changes should use a soft gradient appearance or abrupt color change.NavigationRouteOptions.init(waypoints:profileIdentifier:queryItems:) and NavigationMatchOptions.init(waypoints:profileIdentifier:queryItems:) set the default values for shapeFormat, locale, distanceMeasurementSystem, routeShapeResolution, includesSpokenInstructions, and includesVisualInstructions only if the values were not passed in queryItems. (#4794)Documentation is available online or within Xcode.
ViewportState.routeProgress is deprecated and is always nil now. Use ViewportState.navigationProgress instead.ViewportState.heading is deprecated and is always nil now. Use ViewportState.navigationHeading instead.ViewportState.location is deprecated in favor of ViewportState.navigationLocation instead.ViewportState.init(location:routeProgress:viewportPadding:heading:) is deprecated in favor of ViewportState.init(navigationLocation:navigationProgress:viewportPadding:navigationHeading:).NavigationRoute.nativeRoute, NavigationRoute.init?(nativeRoute:), and AlternativeRoute.init?(mainRoute:alternativeRoute:) are deprecated and should no longer be used.CoreConfig.routeRequestConfig is deprecated. Configure request options directly using RouteOptions and MatchOptions.TelemetryAppMetadata.userId and TelemetryAppMetadata.sessionId are deprecated and no longer have any effect.RouteOptions subclass. If you subclass RouteOptions, make sure to implement urlQueryItems, init(from:), encode(to:), and init(waypoints:profileIdentifier:queryItems:).NavigationRouteOptions.init(waypoints:profileIdentifier:queryItems:) and NavigationMatchOptions.init(waypoints:profileIdentifier:queryItems:) set the default values for shapeFormat, locale, distanceMeasurementSystem, routeShapeResolution, includesSpokenInstructions, and includesVisualInstructions only if the values were not passed in queryItems.RoutingConfig.datasetProfileIdentifier was added to configure the dataset profile for routing tiles. It is important to set this value before initializing MapboxNavigationProvider and use the same value for the following ProfileIdentifier in route requests options.DirectionsOptions subclass.ViewportDataSource for the navigation camera, migrate to viewportState.navigationProgress for tracking active guidance progress.Fixed an incorrect CarPlayActivity value passed in CarPlayManagerDelegate function calls:
carPlayManager(_:, leadingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, trailingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, mapButtonsCompatibleWith traitCollection:, in:, for:).Now CarPlayActivity.panningInBrowsingMode and CarPlayActivity.panningInNavigationMode are passed in the above delegate function calls when the map is panned after showing the panning interface. Previously, those values were only passed at the moment of initial presentation of the panning interface and immediately after performing any panning (or any action that exits the map camera's follow mode), the passed CarPlayActivity was reverted to CarPlayActivity.browsing or CarPlayActivity.navigating even though the panning interface was still shown.
In addition, CarPlayManager.currentActivity is also updated correctly in the mentioned scenarios.
Fixed a problem that navigation bar buttons would not be updated properly for navigation mode when customized with CarPlayManagerDelegate implementation, because of too early execution of calls to CarPlayManagerDelegate functions:
carPlayManager(_:, leadingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, trailingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, mapButtonsCompatibleWith traitCollection:, in:, for:).Those calls were previously executed before CarPlayNavigationViewController instantiation. Now they are performed after CarPlayNavigationViewController instantiation, right after calling CarPlayManagerDelegate.carPlayManager(_:, willPresent:).
NavigationCamera state updates.Task.detached usage in NavigationController.NWPathMonitor caused by a non-stopped monitor.Sendable conformance for types from Turf and Maps.StepsViewController.measurementSystem is now public.ViewportState.routeProgress is deprecated and is always nil now. Use ViewportState.navigationProgress instead.ViewportState.heading is deprecated and is always nil now. Use ViewportState.navigationHeading instead.ViewportState.location is deprecated in favor of ViewportState.navigationLocation instead.ViewportState.init(location:routeProgress:viewportPadding:heading:) is deprecated in favor of ViewportState.init(navigationLocation:navigationProgress:viewportPadding:navigationHeading:).ViewportDataSource for the navigation camera, migrate to viewportState.navigationProgress for tracking active guidance progress.NavigationCamera state updates.Task.detached usage in NavigationController.NWPathMonitor caused by a non-stopped monitor.Sendable conformance for types from Turf and Maps.NavigationRoute.nativeRoute, NavigationRoute.init?(nativeRoute:), and AlternativeRoute.init?(mainRoute:alternativeRoute:) are deprecated and should no longer be used.CoreConfig.routeRequestConfig is deprecated. Configure request options directly using RouteOptions and MatchOptions.TelemetryAppMetadata.userId and TelemetryAppMetadata.sessionId are deprecated and no longer have any effect.RouteOptions subclass. If you subclass RouteOptions, make sure to implement urlQueryItems, init(from:), encode(to:), and init(waypoints:profileIdentifier:queryItems:).NavigationRouteOptions.init(waypoints:profileIdentifier:queryItems:) and NavigationMatchOptions.init(waypoints:profileIdentifier:queryItems:) set the default values for shapeFormat, locale, distanceMeasurementSystem, routeShapeResolution, includesSpokenInstructions, and includesVisualInstructions only if the values were not passed in queryItems.RoutingConfig.datasetProfileIdentifier was added to configure the dataset profile for routing tiles. It is important to set this value before initializing MapboxNavigationProvider and use the same value for the following ProfileIdentifier in route requests options.Fixed an incorrect CarPlayActivity value passed in CarPlayManagerDelegate function calls:
carPlayManager(_:, leadingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, trailingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, mapButtonsCompatibleWith traitCollection:, in:, for:).Now CarPlayActivity.panningInBrowsingMode and CarPlayActivity.panningInNavigationMode are passed in the above delegate function calls when the map is panned after showing the panning interface. Previously, those values were only passed at the moment of initial presentation of the panning interface and immediately after performing any panning (or any action that exits the map camera's follow mode), the passed CarPlayActivity was reverted to CarPlayActivity.browsing or CarPlayActivity.navigating even though the panning interface was still shown.
In addition, CarPlayManager.currentActivity is also updated correctly in the mentioned scenarios.
Fixed a problem that navigation bar buttons would not be updated properly for navigation mode when customized with CarPlayManagerDelegate implementation, because of too early execution of calls to CarPlayManagerDelegate functions:
carPlayManager(_:, leadingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, trailingNavigationBarButtonsCompatibleWith traitCollection:, in:, for:),carPlayManager(_:, mapButtonsCompatibleWith traitCollection:, in:, for:).Those calls were previously executed before CarPlayNavigationViewController instantiation. Now they are performed after CarPlayNavigationViewController instantiation, right after calling CarPlayManagerDelegate.carPlayManager(_:, willPresent:).
StepsViewController.measurementSystem is now public.Note: The Mapbox Electronic Horizon feature of the Mapbox Navigation SDK is in public beta and is subject to changes, including its pricing. Use of the feature is subject to the beta product restrictions in the Mapbox Terms of Service. Mapbox reserves the right to eliminate any free tier or free evaluation offers at any time and require customers to place an order to purchase the Mapbox Electronic Horizon feature, regardless of the level of use of the feature.
RoadObject initializer is now optional.NavigationController.bannerInstructions. Now a new event is published only when a new banner instruction is available and not with every route progress update.precondition and preconditionFailure to avoid possible runtime crashes in Release builds.StandardDayStyle().apply(). The StandardDayStyle and StandardNightStyle are still default values when initializing NavigationViewController and can be changed by setting NavigationOptions.styles value.RouteOptions type from the initial route request instead of a hardcoded type, ensuring additional parameters are preserved on reroutes. (#4789)ProfileIdentifier comparison for the custom profile identifiers, so that route refresh is enabled for custom automobileAvoidingTraffic profiles.Documentation is available online or within Xcode.
Note: The Mapbox Electronic Horizon feature of the Mapbox Navigation SDK is in public beta and is subject to changes, including its pricing. Use of the feature is subject to the beta product restrictions in the Mapbox Terms of Service. Mapbox reserves the right to eliminate any free tier or free evaluation offers at any time and require customers to place an order to purchase the Mapbox Electronic Horizon feature, regardless of the level of use of the feature.
RoadObject initializer is now optional.NavigationController.bannerInstructions. Now a new event is published only when a new banner instruction is available and not with every route progress update.precondition and preconditionFailure to avoid possible runtime crashes in Release builds.StandardDayStyle().apply(). The StandardDayStyle and StandardNightStyle are still default values when initializing NavigationViewController and can be changed by setting NavigationOptions.styles value.