Markers

fun Markers(markers: List<MarkerEntry>, state: MarkersState = rememberMarkersState(), onClick: (MarkerId) -> Unit = { })

Displays a collection of markers on the map (without composition overhead).

Example usages:

@Composable
fun MapScreen() {
TomTomMap() {
Markers(
markers = listOf(
MarkerEntry(
data = MarkerData(
geoPoint = AMSTERDAM,
),
properties = MarkerProperties(
pinImage = ImageFactory.fromResource(R.drawable.ic_marker),
),
),
),
)
}
}

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

Parameters

markers

Collection of markers to display on the map.

state

The UI element state of the Composable.

onClick

Listener invoked when one of the displayed markers is clicked. The lambda is provided with the MarkerId of the marker.