Package-level declarations

Material 3 based controls for the map as an alternative to the default map ornaments.

Types

Link copied to clipboard
Link copied to clipboard
@Immutable
data class AttributionButtonStyle(    val containerColor: Color,     val contentColor: Color,     val tonalElevation: Dp = 0.dp,     val shadowElevation: Dp = 0.dp,     val shape: Shape = RoundedCornerShape(24.dp),     val border: BorderStroke? = null)
Link copied to clipboard
interface ScaleBarMeasure

A measurement system to show in the scale bar.

Link copied to clipboard
data class ScaleBarMeasures(val primary: ScaleBarMeasure, val secondary: ScaleBarMeasure? = null)

Which measures to show on the scale bar.

Functions

Link copied to clipboard
@Composable
fun AttributionLinks(    attributions: List<String>,     linkStyles: TextLinkStyles? = AttributionButtonDefaults.linkStyles(),     spacing: Dp = 8.dp,     breakWithinAttribution: Boolean = false,     modifier: Modifier = Modifier)

A composable function that displays a collection of attribution links as a flow layout.

Link copied to clipboard
@Composable
fun CompassButton(    cameraState: CameraState,     modifier: Modifier = Modifier,     onClick: () -> Unit = {},     colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),     contentDescription: String = stringResource(Res.string.compass),     size: Dp = 48.dp,     contentPadding: PaddingValues = PaddingValues(size / 6),     shape: Shape = CircleShape,     needlePainter: Painter = painterResource(Res.drawable.compass_needle),     getHomePosition: (CameraPosition) -> CameraPosition = { it.copy(bearing = 0.0, tilt = 0.0) })
Link copied to clipboard
@Composable
fun DisappearingCompassButton(    cameraState: CameraState,     modifier: Modifier = Modifier,     onClick: () -> Unit = {},     colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),     contentDescription: String = stringResource(Res.string.compass),     size: Dp = 48.dp,     contentPadding: PaddingValues = PaddingValues(size / 6),     shape: Shape = CircleShape,     needlePainter: Painter = painterResource(Res.drawable.compass_needle),     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)
Link copied to clipboard
@Composable
fun DisappearingScaleBar(    metersPerDp: Double,     zoom: Double,     modifier: Modifier = Modifier,     measures: ScaleBarMeasures = defaultScaleBarMeasures(),     color: Color = LocalContentColor.current,     haloColor: Color = backgroundColorFor(color),     haloWidth: Dp = 0.dp,     barWidth: Dp = 2.dp,     textStyle: TextStyle = MaterialTheme.typography.labelMedium,     alignment: Alignment.Horizontal = Alignment.Start,     visibilityDuration: Duration = 3.seconds,     enterTransition: EnterTransition = fadeIn(),     exitTransition: ExitTransition = fadeOut())

An animated scale bar that appears when the zoom level of the map changes, and then disappears after visibilityDuration. This composable wraps ScaleBar with visibility animations.

Link copied to clipboard
@Composable
fun ExpandingAttributionButton(    cameraState: CameraState,     styleState: StyleState,     modifier: Modifier = Modifier,     contentAlignment: Alignment = Alignment.BottomEnd,     toggleButton: @Composable (onClick: () -> Unit) -> Unit = AttributionButtonDefaults.button,     expandedContent: @Composable (List<String>) -> Unit = AttributionButtonDefaults.content,     expandedStyle: AttributionButtonStyle = AttributionButtonDefaults.expandedStyle(),     collapsedStyle: AttributionButtonStyle = AttributionButtonDefaults.collapsedStyle(),     expand: (Alignment) -> EnterTransition = AttributionButtonDefaults.expand,     collapse: (Alignment) -> ExitTransition = AttributionButtonDefaults.collapse)

Info button from which an attribution popup text is expanded. This version retracts when the user interacts with the map.

@Composable
fun ExpandingAttributionButton(    expanded: Boolean,     onClick: () -> Unit,     styleState: StyleState,     modifier: Modifier = Modifier,     contentAlignment: Alignment = Alignment.BottomEnd,     toggleButton: @Composable (onClick: () -> Unit) -> Unit = AttributionButtonDefaults.button,     expandedContent: @Composable (List<String>) -> Unit = AttributionButtonDefaults.content,     expandedStyle: AttributionButtonStyle = AttributionButtonDefaults.expandedStyle(),     collapsedStyle: AttributionButtonStyle = AttributionButtonDefaults.collapsedStyle(),     expand: (Alignment) -> EnterTransition = AttributionButtonDefaults.expand,     collapse: (Alignment) -> ExitTransition = AttributionButtonDefaults.collapse)

Info button from which an attribution popup text is expanded. This version allows the caller to manage the state.

Link copied to clipboard
@Composable
fun PointerPinButton(    cameraState: CameraState,     targetPosition: Position,     modifier: Modifier = Modifier,     onClick: () -> Unit = {},     enabled: Boolean = true,     colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),     elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),     border: BorderStroke? = null,     contentPadding: PaddingValues = PaddingValues(12.dp),     interactionSource: MutableInteractionSource? = null,     content: @Composable BoxScope.() -> Unit)

An elevated button in the shape of a pointer pin on the edge of an ellipsis drawn inside the parent layout, pointing towards some targetPosition off-screen. Only shown if the targetPosition is outside of the ellipsis.

Link copied to clipboard
@Composable
fun ScaleBar(    metersPerDp: Double,     modifier: Modifier = Modifier,     measures: ScaleBarMeasures = defaultScaleBarMeasures(),     color: Color = LocalContentColor.current,     haloColor: Color = backgroundColorFor(color),     haloWidth: Dp = 0.dp,     barWidth: Dp = 2.dp,     textStyle: TextStyle = MaterialTheme.typography.labelSmall,     alignment: Alignment.Horizontal = Alignment.Start)

A scale bar composable that shows the current scale of the map in feet, meters or feet and meters when zoomed in to the map, changing to miles and kilometers, respectively, when zooming out.