Open bubenheimer opened 7 months ago
This concern could be addressed by making the property non-public or whatever "internal" library consumers actually need.
Also, this property, in its present form, prevents performing initial composition of the GoogleMap()
subcomposition in parallel with GoogleMap
object initialization: #501
Edit: I don't think this is the case, actually.
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 toGoogleMap()
, 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.