Skip to content

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

Description

@matejdro

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions