MapboxCarMapLoader

class MapboxCarMapLoader : MapboxCarMapObserver

Default map style loader that is designed for Android Auto. This map loader assumes you want to keep map styles in sync with the CarContext.isDarkMode.

To use, register an instance to MapboxCarMap.registerObserver. It will automatically load the map for as long as it is registered. To disable you can unregister it with MapboxCarMap.unregisterObserver. Override the Session.onCarConfigurationChanged and call the onCarConfigurationChanged.

Constructors

Link copied to clipboard
fun MapboxCarMapLoader()

Functions

Link copied to clipboard
fun getStyleExtension(isDarkMode: Boolean): StyleContract.StyleExtension

Returns the current style contract. If an override has not been set the default is returned.

Link copied to clipboard
open override fun onAttached(mapboxCarMapSurface: MapboxCarMapSurface)
Link copied to clipboard
fun onCarConfigurationChanged(carContext: CarContext): MapboxCarMapLoader

This will use CarContext.isDarkMode to determine if the dark or light style should be loaded. If this is called while the map is detached, there is no operation.

Link copied to clipboard
open override fun onDetached(mapboxCarMapSurface: MapboxCarMapSurface)
Link copied to clipboard
open fun onStableAreaChanged(@NonNull p0: Rect, @NonNull p1: EdgeInsets)
Link copied to clipboard
open fun onVisibleAreaChanged(@NonNull p0: Rect, @NonNull p1: EdgeInsets)
Link copied to clipboard
fun setDarkStyleOverride(styleContract: StyleContract.StyleExtension?): MapboxCarMapLoader

Set the map style to apply when CarContext.isDarkMode is true. Setting to null will use a default map style.

Link copied to clipboard
fun setLightStyleOverride(styleContract: StyleContract.StyleExtension?): MapboxCarMapLoader

Set the map style to apply when CarContext.isDarkMode is false. Setting to null will use a default map style.