DisappearingCompassButton

fun DisappearingCompassButton(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(), visibilityDuration: Duration = 1.seconds, enterTransition: EnterTransition = fadeIn(), exitTransition: ExitTransition = fadeOut(), getHomePosition: (CameraPosition) -> CameraPosition = { it.copy(bearing = 0.0, tilt = 0.0) }, slop: Double = 0.5)(source)

A CompassButton that appears when the camera turns away from getHomePosition and fades out once the camera returns to it.

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

Parameters

visibilityDuration

How long the button stays visible after the camera returns home.

slop

How far the camera may turn from getHomePosition before the button appears, in degrees.