ScaleBar

@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)(source)

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.

Parameters

metersPerDp

how many meters are displayed in one device independent pixel (dp), i.e. the scale. See CameraState.metersPerDpAtTarget

modifier

the Modifier to be applied to this layout node

measures

which measures to show on the scale bar. If null, measures will be selected based on the system settings or otherwise the user's locale.

color

scale bar and text color.

haloColor

halo for better visibility when displayed on top of the map

haloWidth

scale bar and text halo width

barWidth

scale bar width

textStyle

the text style. The text size is the deciding factor how large the scale bar is is displayed.

alignment

horizontal alignment of the scale bar and text