TileStore

open class TileStore

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.

Functions

Link copied to clipboard
open fun addObserver(@NonNull observer: TileStoreObserver)
Adds a new observer to the TileStore instance.
Link copied to clipboard
@NonNull
@MapboxExperimental
open fun applyTileRegionUpdate(@NonNull id: String, @NonNull options: TileRegionApplyUpdateOptions, @NonNull onProgress: TileRegionLoadProgressCallback, @NonNull onFinished: TileRegionCallback): Cancelable
Updates a tile region using the result of previous call to prepareTileRegionUpdate.
Link copied to clipboard
open fun clearAmbientCache(@NonNull callback: AmbientCacheClearingCallback)
Clears the ambient cache data Equivalent to the other clearAmbientCache() overload with the filters set to include all ambient cache
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
open fun clearAmbientCache(@NonNull callback: AmbientCacheClearingCallback, @NonNull filterOptions: TileStoreAmbientCacheFilterOptions)
WARNING: This API is not intended for public usage.
Link copied to clipboard
open fun computeCoveredArea(@NonNull descriptors: List<TilesetDescriptor>, @NonNull callback: TileRegionGeometryCallback)
Computes a polygon of the area covered by the tiles cached in TileStore with the specified TilesetDescriptors.
Link copied to clipboard
@NonNull
open fun create(): TileStore
Creates a TileStore instance at the default location.
@NonNull
open fun create(@NonNull path: String): TileStore
Creates a TileStore instance for the given storage path.
Link copied to clipboard
@NonNull
open fun estimateTileRegion(@NonNull id: String, @NonNull options: TileRegionLoadOptions, @NonNull onProgress: TileRegionEstimateProgressCallback, @NonNull onFinished: TileRegionEstimateResultCallback): Cancelable
An overloaded version that uses default options.
@NonNull
open fun estimateTileRegion(@NonNull id: String, @NonNull loadOptions: TileRegionLoadOptions, @NonNull estimateOptions: TileRegionEstimateOptions, @NonNull onProgress: TileRegionEstimateProgressCallback, @NonNull onFinished: TileRegionEstimateResultCallback): Cancelable
Estimates the storage and transfer size of a tile region.
Link copied to clipboard
open fun getAllTileRegions(@NonNull callback: TileRegionsCallback)
Returns a list of the existing tile regions.
Link copied to clipboard
open fun getTileRegion(@NonNull id: String, @NonNull callback: TileRegionCallback)
Returns a tile region by its id.
Link copied to clipboard
open fun getTileRegionGeometry(@NonNull id: String, @NonNull callback: TileRegionGeometryCallback)
Returns a tile region's associated geometry The region associated geometry is provided by the client and it represents the area, which the tile region must cover.
Link copied to clipboard
open fun getTileRegionMetadata(@NonNull id: String, @NonNull callback: TileRegionMetadataCallback)
Returns a tile region's associated metadata The region's associated metadata that a user previously set for this region.
Link copied to clipboard
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
open fun getTileRegionTilesets(@NonNull id: String, @NonNull callback: TileRegionTilesetsCallback)
WARNING: This API is not intended for public usage.
Link copied to clipboard
@NonNull
@MapboxExperimental
open fun importArchive(@NonNull options: TileStoreImportOptions, @NonNull onProgress: TileStoreImportProgressCallback, @NonNull onFinished: TileStoreImportCompleteCallback): Cancelable
Import an archive to the tile store.
Link copied to clipboard
@NonNull
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
open fun loadResource(@NonNull description: ResourceDescription, @NonNull options: ResourceLoadOptions, @NonNull progressCallback: ResourceLoadProgressCallback, @NonNull resultCallback: ResourceLoadResultCallback): Cancelable
WARNING: This API is not intended for public usage.
Link copied to clipboard
@NonNull
open fun loadTileRegion(@NonNull id: String, @NonNull loadOptions: TileRegionLoadOptions): Cancelable
An overloaded version that does not report progess or finished status of the loading operation.
@NonNull
open fun loadTileRegion(@NonNull id: String, @NonNull loadOptions: TileRegionLoadOptions, @NonNull onFinished: TileRegionCallback): Cancelable
An overloaded version that does not report progess of the loading operation.
@NonNull
open fun loadTileRegion(@NonNull id: String, @NonNull loadOptions: TileRegionLoadOptions, @NonNull onProgress: TileRegionLoadProgressCallback, @NonNull onFinished: TileRegionCallback): Cancelable
Loads a new tile region or updates the existing one.
Link copied to clipboard
@NonNull
@MapboxExperimental
open fun prepareTileRegionUpdate(@NonNull id: String, @NonNull loadOptions: TileRegionLoadOptions, @NonNull onProgress: TileRegionLoadProgressCallback, @NonNull onFinished: TileRegionCallback): Cancelable
Download incremental updates for a tile region.
Link copied to clipboard
open fun removeObserver(@NonNull observer: TileStoreObserver)
Removes an existing observer from the TileStore instance.
Link copied to clipboard
open fun removeTileRegion(@NonNull id: String)
Removes a tile region.
open fun removeTileRegion(@NonNull id: String, @NonNull callback: TileRegionCallback)
An overloaded version with a callback for feedback.
Link copied to clipboard
@MapboxExperimental
open fun removeTileRegionUpdate(@NonNull id: String, @NonNull callback: TileRegionCallback)
Removes a previously prepared update for a tile region.
Link copied to clipboard
open fun setOption(@NonNull key: String, @NonNull value: Value)
Sets additional options for this instance.
open fun setOption(@NonNull key: String, @NonNull domain: TileDataDomain, @NonNull value: Value)
Sets additional options for this instance that are specific to a data type.
Link copied to clipboard
@NonNull
open fun setRootPath(@NonNull path: String): Expected<String, None>
Configure the path on disk where tiles and metadata will be stored.
Link copied to clipboard
@NonNull
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
open fun subscribeForEvent(@NonNull eventName: String, @NonNull callback: TileStoreGenericEventCallback): Cancelable
WARNING: This API is not intended for public usage.
Link copied to clipboard
open fun tileRegionContainsDescriptors(@NonNull id: String, @NonNull descriptors: List<TilesetDescriptor>, @NonNull callback: TileRegionBooleanCallback)
Checks if a tile region with the given id contains all tilesets and resources from all of the given tileset descriptors.