Reputation: 406
I am trying to create the blue geolocation icon that appears on google maps and that can center the user when clicked on. I have created the permission to ask the user for location already to use google maps, but how can I get their current location ? Is there a way to do it with google maps in compose or is it not yet implemented as a feature?
Upvotes: 1
Views: 2708
Reputation: 300
Use this and I think after that you are good to go!
val cameraPositionState= rememberCameraPositionState()
GoogleMap(
modifier = Modifier.fillMaxSize(),
cameraPositionState=cameraPositionState,
properties = MapProperties(isMyLocationEnabled = true)
)
Upvotes: 7