loadStylePack

open fun loadStylePack(@NonNull styleURI: String, @NonNull loadOptions: StylePackLoadOptions, @NonNull onProgress: StylePackLoadProgressCallback, @NonNull 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.

Return

A `cancelable` object that could be used to cancel the load request.

Parameters

styleURI

The URI of the style package's associated style

loadOptions

The `style pack load options`.

onProgress

The callback that may be invoked multiple times to report progess of the loading operation.

onFinished

The callback that is invoked only once upon success, failure, or cancelation of the loading operation.

open fun loadStylePack(@NonNull styleURI: String, @NonNull loadOptions: StylePackLoadOptions, @NonNull onFinished: StylePackCallback): Cancelable

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

Return

A `cancelable` object that could be used to cancel the load request.

Parameters

styleURI

The URI of the style package's associated style

loadOptions

The `style pack load options`.

onFinished

The callback that is invoked only once upon success, failure, or cancelation of the loading operation.