0

I've a simple GoogleMap in Compose:

GoogleMap(
        modifier = Modifier.fillMaxSize(),
        cameraPositionState = cameraPositionState,
        uiSettings = MapUiSettings(
            compassEnabled = false,
            indoorLevelPickerEnabled = false,
            mapToolbarEnabled = false,
            myLocationButtonEnabled = false,
            rotationGesturesEnabled = false,
            tiltGesturesEnabled = false,
            zoomControlsEnabled = false,
        ),
        googleMapOptionsFactory = {
            GoogleMapOptions()
                .mapColorScheme(MapColorScheme.FOLLOW_SYSTEM)
                .minZoomPreference(10f)
                .maxZoomPreference(18f)
        }
    ) {
        //some markers
    }

but setting minZoomPreference and maxZoomPreference doesn't seem to work, I can zoom in/out however I want.

Am I missing something here?

1 Answer 1

1

searching through Google Issue Tracker lead me to this issue which contains the solution:

GoogleMap(
    
    properties = MapProperties(
        maxZoomPreference = 18f,
        minZoomPreference = 10f,
    ),
)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.