Map Download lifecycle
In this guide we are going to cover the offline maps download life-cycle and how to monitor statuses. The SDK prepares the shared Preview Bundle and regional packages in parallel. Call beginDownloadPage(withOwner:) when the download screen appears and endDownloadPage() when it closes. This lets the SDK prepare shared preview resources early while keeping screen ownership bound to the active UI.
The first use requires an internet connection. After the shared resources have been cached successfully, the SDK can load them from local storage.
A task can remain in .preparingOfflineDisplay at up to 99% while the SDK prepares preview resources. The task reaches 100% only after the preview style, TileJSON/source, glyphs, sprites, and preview database have been validated and applied to the map engine.
Observe shared preview resource status
Read the current status synchronously when needed:
Remove the listener when it is no longer needed: