Package-level declarations

Map controls using the Material 3 color scheme and typography.

Map controls using the Material 3 color scheme and typography.

Types

Link copied to clipboard
Link copied to clipboard

Material 3 themed defaults for LocationPuck parameters

Link copied to clipboard

Properties

Link copied to clipboard

Applies the Material 3 color scheme and typography to the controls from MapOverlay.Default.

Link copied to clipboard

Applies the Material 3 color scheme and typography to the controls from MapOverlay.AttributionOnly.

Link copied to clipboard

Applies the Material 3 color scheme and typography to the controls from MapOverlay.Full.

Functions

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

Attribution links in a flow layout using the Material 3 theme.

Link copied to clipboard
fun MapOverlayScope.CompassButton(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) })

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

Link copied to clipboard
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)

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

Link copied to clipboard
fun DisappearingScaleBar(metersPerDp: Double, zoom: Double, modifier: Modifier = Modifier, measures: ScaleBarMeasures = ScaleBarDefaults.measures(), 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
fun MapOverlayScope.ExpandingAttributionButton(modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.BottomEnd, toggleButton: @Composable (onClick: () -> Unit) -> Unit = AttributionButtonDefaults.button, expandedContent: @Composable (attributions: List<String>, textStyle: TextStyle) -> Unit = AttributionButtonDefaults.content, expandedStyle: AttributionStyle = AttributionButtonDefaults.expandedStyle(), collapsedStyle: AttributionStyle = AttributionButtonDefaults.collapsedStyle(), expand: (Alignment) -> EnterTransition = AttributionDefaults.expand, collapse: (Alignment) -> ExitTransition = AttributionDefaults.collapse)

An attribution popup that collapses when the user interacts with the map.

Link copied to clipboard
fun OfflinePackListItem(pack: OfflinePack, offlineManager: OfflineManager, modifier: Modifier = Modifier, leadingContent: @Composable () -> Unit = { OfflinePackListItemDefaults.LeadingContent(pack) }, supportingContent: @Composable () -> Unit = { OfflinePackListItemDefaults.SupportingContent(pack.downloadProgress) }, trailingContent: @Composable () -> Unit = { OfflinePackListItemDefaults.TrailingContent(pack, offlineManager) }, headlineContent: @Composable () -> Unit)

A ListItem to manage an OfflinePack.

Link copied to clipboard
fun MapOverlayScope.PointerPinButton(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, placed through placedTowards on the edge of an ellipse inscribed in the unobstructed map region and pointing towards targetPosition. Only shown while targetPosition is outside of the ellipse.

Link copied to clipboard
fun ScaleBar(metersPerDp: Double, modifier: Modifier = Modifier, measures: ScaleBarMeasures = ScaleBarDefaults.measures(), 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.

Link copied to clipboard
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) })

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