CarNavigationInfoProvider

class CarNavigationInfoProvider : MapboxCarMapObserver

Provides the NavigationTemplate.NavigationInfo and TravelEstimate populated with Mapbox navigation data. This can be used with a Screen that shows a NavigationTemplate.

See also

Constructors

Link copied to clipboard
fun CarNavigationInfoProvider()

Public constructor and the internal constructor is for unit testing.

Functions

Link copied to clipboard
fun invalidateOnChange(screen: Screen): CarNavigationInfoProvider

Helper function to allow you to hook up the provider to a screen. The screen will be invalidated when the data changes, and you can populate the NavigationTemplate with the navigation info inside Screen.onGetTemplate.

Link copied to clipboard
open override fun onAttached(mapboxCarMapSurface: MapboxCarMapSurface)

MapboxCarMapSurface is attached

Link copied to clipboard
open override fun onDetached(mapboxCarMapSurface: MapboxCarMapSurface)

MapboxCarMapSurface is detached

Link copied to clipboard
open fun onVisibleAreaChanged(visibleArea: Rect, edgeInsets: EdgeInsets)
Link copied to clipboard

When you have a NavigationTemplate.Builder, you can set the navigation info and travel estimate

Properties

Link copied to clipboard
val carNavigationInfo: StateFlow<CarNavigationInfo>

Contains data that helps populate the NavigationTemplate with navigation data.