Skip to content

DisappearingScaleBar: scale does not update when zooming #759

@kohenkatz

Description

@kohenkatz

Environment details

  • Android 16 on Pixel 6
  • Android Maps Compose 6.10.0
  • Google Play Services Maps 19.2.0

Steps to reproduce

  1. Create a map with an initial zoom level
  2. Zoom in and out - observe that the scale remains at whatever the initial zoom level was

Code example

@Composable
fun MapCard(
    modifier: Modifier = Modifier,
) {
    val cameraPositionState = rememberCameraPositionState {
        // Default to showing full USA
        position = CameraPosition.fromLatLngZoom(LatLng(39.5, -98.35), 3f)
    }

    Card(
        modifier = modifier
    ) {
        Box(
            modifier = Modifier.fillMaxSize()
        ) {
            GoogleMap(
                modifier = Modifier.fillMaxSize(),
                cameraPositionState = cameraPositionState,
                properties = MapProperties(
                    isBuildingEnabled = true,
                    isIndoorEnabled = true,
                ),
            )

            DisappearingScaleBar(
                modifier = Modifier
                    .padding(bottom = 20.dp, start = 10.dp)
                    .align(Alignment.BottomLeft),
                cameraPositionState = cameraPositionState,
            )
        }
    }
}

Video

Screen_recording_20250909_215407.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasedtriage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions