hey I'm struggling to find the way to do handle on...
# compose
n
hey I'm struggling to find the way to do handle onClick between composable... I have a screen with a mapView (used the Crane sample), and I want to have a Center location FAB, I'm not sure how to handle the click to make the mapView center on the wanted location, sample in comment
Copy code
@Composable
private fun Map(latitude: Double, longitude: Double) {
    val mapView = rememberMapViewWithLifecycle()
    LaunchedEffect(map, mapInitialized) {
        if (!mapInitialized) {
            val googleMap = map.awaitMap()
            val position = LatLng(latitude, longitude)
            googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(position, 16f))
            mapInitialized = true
        }
            AndroidView({ map })
    }
}

Box  {
    Map {
        
    }
    FloatingActionButton(onClick = { 
        //what to do here ?
    }) {

    }

}
sample has been simplified, but here it's not really a state but an event, I'm not sure how to represent it from a compose POV ?
it would of course be easy if the FloatingActionButton would be in the Map Composable but I want to find a way outside this
I think I have to put
Copy code
val mapView = rememberMapViewWithLifecycle()
in the Box block actually, so that I can do something on the mapview from the FloatingActionButton