Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matejdro opened this issue Sep 11, 2024 · 3 comments
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@matejdro
Copy link

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).

@matejdro matejdro added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Sep 11, 2024
@alaershov
Copy link

I would love a solution to this issue as well, it's a big UX downgrade from good old Activity navigation, when all Views are immediately visible after navigating back. Especially for apps like car sharing, where the map is a root screen, and all other screen navigation happens over the map screen.

Here is a sample with Jetpack Navigation and Compose Google Map

google.map.compose.sample.mp4

@geworfener
Copy link

geworfener commented Oct 22, 2024

Related #155

@matejdro
Copy link
Author

matejdro commented Oct 22, 2024

I think your link is broken.

Here is a working one: #155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants