MBMOfflineManager
@interface MBMOfflineManager : NSObject
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.
-
Unavailable
Undocumented
Declaration
Objective-C
- (nonnull instancetype)init NS_UNAVAILABLE; -
Unavailable
Undocumented
Declaration
Objective-C
+ (nonnull instancetype)new NS_UNAVAILABLE; -
Construct a new
offline manager.Declaration
Objective-C
- (nonnull instancetype)initWithResourceOptions: (nonnull MBMResourceOptions *)resourceOptions;Swift
init(resourceOptions: MBMResourceOptions)Parameters
resourceOptionsThe
resource optionsto manage. -
Construct a new
tileset descriptorfor thetile store.Tileset descriptors are used by the
tile storeto 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.Declaration
Objective-C
- (nonnull MBXTilesetDescriptor *) createTilesetDescriptorForTilesetDescriptorOptions: (nonnull MBMTilesetDescriptorOptions *)tilesetDescriptorOptions;Swift
func createTilesetDescriptor(for tilesetDescriptorOptions: MBMTilesetDescriptorOptions) -> MBXTilesetDescriptorParameters
tilesetDescriptorOptionsThe
tileset descriptor optionsto manage.Return Value
A new
tileset descriptor. -
An overloaded version that accepts
TilesetDescriptorOptionsForTilesets.This method is helpful if the required tilesets do not originally belong to a style, e.g. when their corresponding style sources are added using runtime API.
Declaration
Objective-C
- (nonnull MBXTilesetDescriptor *) createTilesetDescriptorForTilesetDescriptorOptionsForTilesets: (nonnull MBMTilesetDescriptorOptionsForTilesets *) tilesetDescriptorOptionsForTilesets;Swift
func createTilesetDescriptorForTilesetDescriptorOptions(_ tilesetDescriptorOptionsForTilesets: MBMTilesetDescriptorOptionsForTilesets) -> MBXTilesetDescriptorParameters
tilesetDescriptorOptionsForTilesetsThe
tileset descriptor optionsto manage.Return Value
A new
tileset descriptor. -
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
Cancelederror.Declaration
Objective-C
- (void)removeStylePackForStyleURI:(nonnull NSString *)styleURI;Swift
func removeStylePack(forStyleURI styleURI: String)Parameters
styleURIThe URI of the style package’s associated style
-
Undocumented
Declaration
Objective-C
- (nonnull MBXCancelable *)loadStylePackForStyleURI:(nonnull NSString *)styleURI loadOptions:(nonnull MBMStylePackLoadOptions *)loadOptions onProgress:(nonnull MBMStylePackLoadProgressCallback)onProgress onFinished:(nonnull MBMStylePackCallback)onFinished __attribute((ns_returns_retained)) NS_REFINED_FOR_SWIFT; -
Undocumented
Declaration
Objective-C
- (nonnull MBXCancelable *)loadStylePackForStyleURI:(nonnull NSString *)styleURI loadOptions:(nonnull MBMStylePackLoadOptions *)loadOptions onFinished:(nonnull MBMStylePackCallback)onFinished __attribute((ns_returns_retained)) NS_REFINED_FOR_SWIFT; -
Undocumented
Declaration
Objective-C
- (void)getAllStylePacksForCallback:(nonnull MBMStylePacksCallback)callback NS_REFINED_FOR_SWIFT; -
Undocumented
Declaration
Objective-C
- (void)getStylePackForStyleURI:(nonnull NSString *)styleURI callback:(nonnull MBMStylePackCallback)callback NS_REFINED_FOR_SWIFT; -
Undocumented
Declaration
Objective-C
- (void)getStylePackMetadataForStyleURI:(nonnull NSString *)styleURI callback:(nonnull MBMStylePackMetadataCallback)callback NS_REFINED_FOR_SWIFT;
MBMOfflineManager Class Reference