Allow style customization in CarPlay #1836
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Applications can now customize the style of the map in CarPlay (nominally the rest of the CarPlay interface, but really just the map style).
Renamed
CarPlayManager(_:)
toCarPlayManager(styles:eventsManager:)
andCarPlayNavigationViewController(with:mapTemplate:interfaceController:manager:styles:)
toCarPlayNavigationViewController(navigationService:mapTemplate:interfaceController:manager:styles:)
. These initializers now accept Style objects as arguments, which are applied throughout the CarPlay interface, similar to NavigationViewController. DayStyle and NightStyle are still used by default but no longer hard-coded everywhere. The application can setCarPlayManager.styles
at any time to change the map style, for example if it sets the style of NavigationViewController or a standalone NavigationMapView on the phone and needs to synchronize the change on CarPlay.Renamed
StyleManager(_:)
toStyleManager()
. The previous initializer looked like it gave ownership of the delegate to StyleManager, whereas it was just a weak reference. Client code is now expected to set thedelegate
property explicitly.Exposed a few more CarPlayManager members to Objective-C code. Fixed some build warnings.
Fixes #1823.
/cc @mapbox/navigation-ios