-
-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Feature Description
Currently, if you remove and reinsert the composable containing a map, the map will be destroyed and reinitialized, and there's nothing the user can do to retain it. With the Android and iOS SDKs, that's necessary, because the map is tied to its View, which is owned by the composable.
It's hard to reason about a composable's life cycle, and composables should be designed to be cheap to reinitialize. So in an ideal world, it should be possible for the user to take control of the map lifecycle, for example retaining it in a ViewModel or a Compose 1.10 retain
block regardless of whether it's displayed in the UI at the moment. And have it be cheap to attach an already initialized map to the UI. This will enable easier testing and a more predictable map life cycle.
With native core integration, we control the renderer frontend ourselves, and so have the opportunity to decouple the map from the surface it renders to. Unsure if this is possible with MapLibre JS; can we detach and re-attach a Canvas from the map?
Prerequisites:
- complete native core integration for desktop, Android, and iOS
- investigate how such a change would affect web