Marker
Composable function to add a simple Marker to the Map.
Marker is a convenience which creates a simple ViewAnnotation with limited customization options. Use Marker to quickly add a pin annotation at the specific coordinates. If you need greater customization use ViewAnnotation directly.
Marker is great for displaying unique interactive features. However, it may be suboptimal for large amounts of data and doesn't support clustering. Each marker creates Compose views with custom text rendering, so for scenarios with 100+ markers, consider using PointAnnotation.
Markers support animations via two parameters:
appearAnimation: Effects that play when the marker first appearsdisappearAnimation: Effects that play when the marker is removed
Available effects: MarkerAnimationEffect.wiggle, MarkerAnimationEffect.scale, MarkerAnimationEffect.fadeIn, MarkerAnimationEffect.fadeOut
Example:
Marker(
point = point,
appearAnimation = listOf(MarkerAnimationEffect.wiggle, MarkerAnimationEffect.scale),
disappearAnimation = listOf(MarkerAnimationEffect.fadeOut),
onClick = { println("Marker clicked!") }
)Parameters
The geographic location of the Marker
The outer color of the Marker
The inner color of the Marker
The color of optional strokes. Pass null to remove the strokes.
A text to be displayed with the Marker
Effects to play when marker appears
Effects to play when marker disappears
Optional callback to be invoked when the marker is clicked