Option to center camera on current location on map load
Is your feature request related to a problem? Please describe.
I'd like to be able to configure the map to start with the camera on my current location without having to press a button. It seems like a waste of time to do it all manually, pulling in the dependency for the fused location provider, abstracting it, etc., when the SDK already has the current location, and can show it if isMyLocationEnabled is true.
Describe the solution you'd like
Perhaps a property in MapProperties called startAtCurrentLocation.
Describe alternatives you've considered Requesting the user's current location, then setting it as a camera update on map load.
If you want to start the map at a particular location you can use rememberCameraPositionState's position argument.
For example
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(currentUserLocaiton, 17f)
}
Pass this position state in the GoogleMap composable function and the map will start at that particular location.
If you want to start the map at a particular location you can use
rememberCameraPositionState's position argument.For example
val cameraPositionState = rememberCameraPositionState { position = CameraPosition.fromLatLngZoom(currentUserLocaiton, 17f) }Pass this position state in the GoogleMap composable function and the map will start at that particular location.
Yes, I'm aware of this. As this is a feature request, I'm not looking for you to tell me how to do it (unless this feature already exists in some fashion).
As far as I can tell, there shouldn't be a need for me to go through the process of pulling in the fused location provider dependency, and fetching the user's current location, if the maps SDK already has the user's current location.
It's also possible that the location I get from the fused client differs slightly from what the map displays as the user's current position.
Essentially, I'm looking for the same functionality the "My Location" button provides, without needing the user to manually press it.
I would also find this a useful feature