Marker

fun Marker(data: MarkerData, properties: MarkerProperties, state: MarkerState = rememberMarkerState(), isVisible: Boolean = true, onClick: () -> Unit = { }, onLongClick: () -> Unit = { })

Displays a marker on the map view.

Example usages:

val mapViewState = rememberMapViewState()

TomTomMap(
state = mapViewState
) {
Marker(
data = MarkerData(geoPoint = ...)
isVisible = mapViewState.cameraState.data.position.zoom < 10.0
)
}

Use Markers to display multiple markers without composition overhead.

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

Parameters

data

The marker data.

properties

The properties of the marker. The properties define how the marker is visualized.

state

The UI element state of the Composable.

isVisible

Whether the marker should be visible or not.

onClick

A lambda that is called when the marker is clicked. The lambda is provided with the marker ID.

onLongClick

A lambda that is called when the marker is long clicked. The lambda is provided with the marker ID.