CompassButton

fun CompassButton(cameraState: CameraState, modifier: Modifier = Modifier, onClick: () -> Unit = {}, colors: ButtonColors = ButtonDefaults.elevatedButtonColors(), contentDescription: String = CompassDefaults.contentDescription(), size: Dp = 48.dp, contentPadding: PaddingValues = PaddingValues(size / 6), shape: Shape = CircleShape, needlePainter: Painter = CompassDefaults.needlePainter(), getHomePosition: (CameraPosition) -> CameraPosition = { it.copy(bearing = 0.0, tilt = 0.0) })(source)

A compass that points north and returns the camera to getHomePosition when it is clicked.

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

Parameters

cameraState

The camera that the needle follows and that a click resets.

onClick

Called after the camera animation starts.

colors

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

contentDescription

Accessibility label for the needle.

size

Width and height of the button.

contentPadding

Gap between the button edge and the needle.

shape

Shape of the button.

needlePainter

The needle artwork, drawn without a tint.

getHomePosition

The camera position that a click returns to.