googlemaps / googlemaps/android-maps-compose

Add ability to persist/cache map tiles and render state when map Composable goes out of scope

Open
#627 3 comments 13 reactions 0 assignees View on GitHub
priority: p2 type: feature request
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

**Is your feature request related to a problem? Please describe.**

When a screen with a map goes to the backstack, GoogleMap composable and all tiles/render state that it has, is destroyed. When user comes back to the map, it needs to reload all tiles and render everything from scratch, resulting in a bad user experience, since opening something over map and then going back will cause the map to spend a second or two reloading (especially on slower devices)

**Describe the solution you'd like**

Ability to provide a render state object to the map, where all render status would be saved/cached. That object can then be saved somewhere, where it would survive going to the backstack (for example, in a ViewModel). When user goes back to the map, that saved object would be provided to the map, resulting in a map instantly rendering to the exact state it was before.

**Describe alternatives you've considered**
I don't see any good alternatives to that. One possible alternative is to not ever remove map Composable from the screen and show every subsequent screen as a dialog or an Activity, which is pretty limiting (and goes against single activity principle).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.