OfflineManagerInterface(androidJvm)

An `offline manager` manages downloads and storage for style packages and also produces tileset descriptors for the `tile store`. All the asynchronous methods calls complete even if the `offline manager` instance gets out of scope before.

interface OfflineManagerInterface(androidJvm)

Functions

createTilesetDescriptor
Link copied to clipboard

Construct a new `tileset descriptor` for the `tile store`. Tileset descriptors are used by the `tile store` to create new offline regions. Resolving the created tileset descriptor includes loading and parsing the style and might include creation or update of a style package - depending on the given options.

abstract fun createTilesetDescriptor(tilesetDescriptorOptions: TilesetDescriptorOptions): TilesetDescriptor
getAllStylePacks
Link copied to clipboard

Returns a list of the existing style packages. Note: The user-provided callbacks will be executed on a worker thread; it is the responsibility of the user to dispatch to a user-controlled thread.

abstract fun getAllStylePacks(callback: StylePacksCallback)
getStylePack
Link copied to clipboard

Returns a style package by its id. Note: The user-provided callbacks will be executed on a worker thread; it is the responsibility of the user to dispatch to a user-controlled thread.

abstract fun getStylePack(styleURI: String, callback: StylePackCallback)
getStylePackMetadata
Link copied to clipboard

Returns a style package's associated metadata The style package's associated metadata that a user previously set.

abstract fun getStylePackMetadata(styleURI: String, callback: StylePackMetadataCallback)
loadStylePack
Link copied to clipboard

An overloaded version that does not report progess of the loading operation.

abstract fun loadStylePack(styleURI: String, loadOptions: StylePackLoadOptions, onFinished: StylePackCallback): Cancelable

Loads a new style package or updates the existing one. If a style package with the given id already exists, it gets updated with the values provided to the given load options. The missing resources get loaded and the expired resources get updated. If there no values provided to the given load options, the existing style package gets refreshed: the missing resources get loaded and the expired resources get updated. A failed load request can be reattempted with another loadStylePack() call. If the style cannot be fetched for any reason, the load request is terminated. If the style is fetched but loading some of the style package resources fails, the load request proceeds trying to load the remaining style package resources.

abstract fun loadStylePack(styleURI: String, loadOptions: StylePackLoadOptions, onProgress: StylePackLoadProgressCallback, onFinished: StylePackCallback): Cancelable
removeStylePack
Link copied to clipboard

Removes a style package. Removes a style package from the existing packages list. The actual resources eviction might be deferred as the implementation can first put the resources to the disk cache. Call `MapboxMap#clearData()` API to make sure all the temporary data is physically removed from the disk cache. All pending loading operations for the style package with the given id will fail with `Canceled` error.

abstract fun removeStylePack(styleURI: String)

Inheritors

OfflineManager
Link copied to clipboard