QenBau
QenBau

Reputation: 405

Loading of GoogleMap in Compose is really slow

I am using the Maps Compose Library to display a map:

@Composable
fun Maps(latLng: LatLng, radius: Float) {
    val uiSettings = remember { MapUiSettings(zoomControlsEnabled = false, rotationGesturesEnabled = false) }

    val cameraPosition = CameraPosition(latLng, 15f, 0F, 0F)


    GoogleMap(modifier = Modifier.fillMaxSize(), uiSettings = uiSettings, cameraPositionState = CameraPositionState(cameraPosition)) 
}

however, the initial loading is very slow:

Skipped 51 frames! The application may be doing too much work on its main thread.

So, I was wondering if there is a way to fix this so that the user can interact with the other elements on the screen while the map is loading.

Upvotes: 4

Views: 1429

Answers (1)

Megh Lath
Megh Lath

Reputation: 2138

You can integrate this-> https://github.com/googlemaps/android-maps-compose open-source library through which you will be able to access states like loading, success, failure!

Upvotes: 0

Related Questions