ZoomButtons

fun MapOverlayScope.ZoomButtons(modifier: Modifier = Modifier, onZoomIn: () -> Unit = {}, onZoomOut: () -> Unit = {}, colors: ButtonColors = ButtonDefaults.elevatedButtonColors(), dividerColor: Color = MaterialTheme.colorScheme.outlineVariant, contentDescriptionZoomIn: String = ZoomButtonsDefaults.contentDescriptionZoomIn(), contentDescriptionZoomOut: String = ZoomButtonsDefaults.contentDescriptionZoomOut(), width: Dp = 48.dp, contentPadding: PaddingValues = PaddingValues(12.dp), shape: Shape = RoundedCornerShape(percent = 50), zoomInPainter: Painter = ZoomButtonsDefaults.zoomInPainter(), zoomOutPainter: Painter = ZoomButtonsDefaults.zoomOutPainter(), getZoomInPosition: (CameraPosition) -> CameraPosition = { it.copy(zoom = it.zoom + 1) }, getZoomOutPosition: (CameraPosition) -> CameraPosition = { it.copy(zoom = it.zoom - 1) })(source)

Buttons that zoom the camera in and out, drawn as one vertical segmented container.

This is org.maplibre.compose.overlay.ZoomButtons with the colors, shape, and elevation of an ElevatedButton.

Parameters

onZoomIn

Called when the zoom-in button is clicked, once its animation is requested.

onZoomOut

Called when the zoom-out button is clicked, once its animation is requested.

colors

Container and content colors, defaulting to those of an ElevatedButton.

dividerColor

Color of the divider between the buttons.

contentDescriptionZoomIn

Accessibility label for the zoom-in button.

contentDescriptionZoomOut

Accessibility label for the zoom-out button.

width

Width of the container. Each button is a square of this size.

contentPadding

Gap between a button edge and its icon.

shape

Shape of the container.

zoomInPainter

The plus artwork, tinted with the content color.

zoomOutPainter

The minus artwork, tinted with the content color.

getZoomInPosition

The camera position that the zoom-in button animates to.

getZoomOutPosition

The camera position that the zoom-out button animates to.