DisappearingCompassButton
fun MapOverlayScope.DisappearingCompassButton(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, contentModifier: Modifier = Modifier)(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
contentModifier
Applied to the button inside the visibility animation. Padding here expands and shrinks with the button, unlike modifier, which sits on the visibility wrapper.
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.