MTCustomAnnotationView

fun MTCustomAnnotationView(controller: MTMapViewController, coordinates: LngLat, offset: MTPoint = MTPoint(0.0, 0.0), anchor: Alignment = Alignment.Center, modifier: Modifier = Modifier, content: @Composable () -> Unit)

Compose-based custom annotation view that can be overlaid on top of MTMapView.

Usage: Place this composable in the same Box (overlay) as your MTMapView so it can position itself using absolute pixel offsets.

Example:

Box(Modifier.fillMaxSize()) { MTMapView(referenceStyle, options, controller, Modifier.fillMaxSize()) MTCustomAnnotationView(controller, LngLat(16.6, 49.2)) { YourComposable() } }

Requirements: This view relies on ON_MOVE and ON_ZOOM events. Set MTMapOptions.eventLevel to CAMERA_ONLY (recommended) or ALL so these events are forwarded.

Parameters

controller

The map controller used to project coordinates and observe events.

coordinates

Geographic location of this annotation.

offset

Pixel offset from the projected point (x to the right, y down).

anchor

Which point of the content should align with the projected point.

modifier

Additional modifiers applied to the positioned Box that wraps content.

content

The composable content to render as the custom annotation.