androidkotlingoogle-mapsandroid-jetpack-composejetpack-compose-modalbottomsheet

How to pan GoogleMap composable inside ModalBottomSheet in JetPack Compose


I'm trying to put a GoogleMap() composable inside a ModalBottomSheet() in JetPack Compose. Here is a very simplified version of the code:

        ModalBottomSheet(onDismissRequest = {  }) {
            GoogleMap() {}
        }

My problem is that dragging on the map drags the ModalBottomSheet instead of panning the GoogleMap.

How do I get the GoogleMap to pan with user touch?

Click below to see the current behavior: https://imgur.com/a/fsrflt8


Solution

  • If you are using the Compose Material3 version of ModalBottomSheet(), try passing false for the sheetGesturesEnabled parameter.