googlemaps / googlemaps/android-maps-compose

Remove public currentCameraPositionState property

Open
#500 2 comments 0 reactions 0 assignees View on GitHub
priority: p2 type: feature request
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

Compose 4.3.0

#262 introduced a _public_ currentCameraPositionState property. I don't think this was a good idea from an architectural standpoint, as this allows & suggests configuring the map from inside the map subcomposition by user code. Map configuration is generally intended to be done at the top level via parameters of the `GoogleMap()` composable. `CameraPositionState` is one of the parameters passed to `GoogleMap()`, duplicating responsibilities for CameraPositionState configuration.

If user code does need access to CameraPositionState from inside the subcomposition it can pass it down itself in whatever form it deems most appropriate: read-only position, read/write state, or some other kind of wrapper; captured lambda variable, parameter, or CompositionLocal. These decisions need to be left to user code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.