RoutingVisualization

fun RoutingVisualization(infrastructure: RoutingVisualizationInfrastructure, state: RoutingVisualizationState = rememberRoutingVisualizationState(), onRouteClick: (RouteId) -> Unit = { }, onRouteStopClick: (RouteStopId) -> Unit = { }, content: @Composable RoutingVisualizationScope.() -> Unit = { })

Routing visualization composable on the TomTomMap.

Example usages:

@Composable
fun MapScreen(
viewModel: MapScreenViewModel = viewModel()
) {
val mapViewState = rememberMapViewState()

TomTomMap(
infrastructure = viewModel.mapDisplayInfrastructure
state = mapViewState
) {
RoutingVisualization(
infrastructure = viewModel.infrastructure
) {
TrafficVisualization(
state = rememberTrafficVisualizationState()
)
}
}
}

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

Parameters

infrastructure

The infrastructure of the RoutingVisualization Composable.

state

The state of routing visualization composable.

onRouteClick

Route click callback. The callback is provided with the RouteId of the route.

onRouteStopClick

Route stop click callback. The callback is provided with the RouteStopId of the route stop.

content

One ore more composable that extend the RoutingVisualizationScope. Each composable configures a part of the routing visualization.

See also