Traffic

fun Traffic(state: TrafficState = rememberTrafficState(), onTrafficIncidentClick: (trafficIncidents: List<TrafficIncident>, geoPoint: GeoPoint) -> Unit = { _, _ -> })

Controls the (off-route) traffic information shown on the map.

Important: Use named parameters to avoid ambiguous method calls due to API changes.

Parameters

state

The UI element state of the Traffic composable.

onTrafficIncidentClick

A lambda invoked a traffic incident is clicked. The lambda is provided with the list of TrafficIncidents on this point of the map and the corresponding GeoPoint.