OfflineManager
An instance of this interface is a singleton that manages offline packs and ambient caching.
An offline pack represents a collection of resources needed to display a region offline, including map tiles, styles, and other assets. It allows you to selectively download regions of the map to be made available offline.
The ambient cache is a temporary storage mechanism used to improve map loading performance and reduce network requests. It caches map tiles and other resources that the map renders, allowing them to be retrieved faster on subsequent map views or when zooming into previously viewed areas. The ambient cache is distinct from offline packs, which are used for persistent offline access.
Properties
Functions
Clears the ambient cache by deleting resources. This method does not affect resources shared with offline regions.
Creates and registers an offline pack that downloads the resources needed to use the given region offline. The pack starts paused; to actually start the download, call resume.
Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be freed.
Invalidates the specified offline pack. This method checks that the tiles in the specified pack match those from the server. Local tiles that do not match the latest version on the server are updated.
Invalidates the ambient cache. This method checks that the tiles in the ambient cache match those from the server. If the local tiles do not match those on the server, they are re-downloaded.
Pause downloading if the pack is downloading.
Resume downloading if the pack is paused. Must be called after create to start downloading.
Sets the maximum ambient cache size in bytes. The default maximum cache size is 50 MB. To disable ambient caching, set the maximum ambient cache size to 0. Setting the maximum ambient cache size does not impact the maximum size of offline packs.
Sets the maximum number of tiles that may be downloaded and stored on the current device. By default, the limit is set to 6000.