MBXTileStore


@interface MBXTileStore : NSObject

TileStore manages downloads and storage for requests to tile-related API endpoints, enforcing a disk usage quota: tiles available on disk may be deleted to make room for a new download. This interface can be used by an app developer to set the disk quota. The rest of TileStore API is intended for native SDK consumption only.

  • Creates a TileStore instance for the given storage path.

    The returned instance exists as long as it is retained by the client. If the tile store instance already exists for the given path this method will return it without creating a new instance, thus making sure that there is only one tile store instance for a path at a time.

    If the given path is empty, the tile store at the default location is returned. On iOS, this storage path is excluded from automatic cloud backup. On Android, please exclude the storage path in your Manifest. Please refer to the Android Documentation for detailed information.

    Declaration

    Objective-C

    + (nonnull MBXTileStore *)createForPath:(nonnull NSString *)path;

    Parameters

    path

    The path on disk where tiles and metadata will be stored

    Return Value

    Returns a TileStore instance.

  • Creates a TileStore instance at the default location.

    If the tile store instance already exists for the default location this method will return it without creating a new instance, thus making sure that there is only one tile store instance for a path at a time.

    Declaration

    Objective-C

    + (nonnull MBXTileStore *)create;

    Return Value

    Returns a TileStore instance.

  • An overloaded version that does not report progess or finished status of the loading operation.

    Declaration

    Objective-C

    - (nonnull MBXCancelable *)
        loadTileRegionForId:(nonnull NSString *)id
                loadOptions:(nonnull MBXTileRegionLoadOptions *)loadOptions;

    Parameters

    id

    The tile region identifier.

    loadOptions

    The tile region load options.

    Return Value

    Returns a Cancelable object to cancel the load request

  • Removes a tile region.

    Removes a tile region from the existing packages list. The actual resources eviction might be deferred. All pending loading operations for the tile region with the given id will fail with Canceled error.

    Declaration

    Objective-C

    - (void)removeTileRegionForId:(nonnull NSString *)id;

    Parameters

    id

    The tile region identifier.

  • Sets additional options for this instance.

    Declaration

    Objective-C

    - (void)setOptionForKey:(nonnull NSString *)key value:(nonnull id)value;

    Parameters

    key

    The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions.

    value

    The value for the configuration option, or null if it should be reset.

  • Sets additional options for this instance that are specific to a data type.

    Declaration

    Objective-C

    - (void)setOptionForKey:(nonnull NSString *)key
                     domain:(MBXTileDataDomain)domain
                      value:(nonnull id)value;

    Parameters

    key

    The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions.

    domain

    The data type this setting should be applied for.

    value

    The value for the configuration option, or null if it should be reset.