android-maps-utils icon indicating copy to clipboard operation
android-maps-utils copied to clipboard

Cluster Manager Save Instance State

Open sshrop opened this issue 1 year ago • 0 comments

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

Throughout a Fragment's lifecycle, Android can be quite aggressive when destroying and recreating a fragment's view. It's almost certain to require instance state restoration when a user navigates from a fragment that hosts a MapView.

In my case, I'm forced to recreate a ClusterManager to redraw my markers when the host fragment is made visible again. Recreating custom markers can be a time consuming process, and a visual blip in the map can negatively affect the user experience.

Describe the solution you'd like

A first-class feature that allows the ClusterManger to be rebound to a newly created map view, allowing for fast recovery of the MapView's state including all markers and state of interaction e.g. restoration of a visible item info window that was activated before the view was destroyed.

Describe alternatives you've considered

I haven't seen any documentation on how to handle UI state restoration. I'm wondering if I need to:

  • Cache custom marker Bitmaps in memory
  • Keep track of active item info windows

Additional context

Thanks in advance. I can provide additional context as needed to clarify my concern.

sshrop avatar Jul 19 '22 01:07 sshrop