TileStore(androidJvm)

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.

open class TileStore(androidJvm)

Functions

addObserver
Link copied to clipboard

Adds a new observer to the TileStore instance. Note that observers will be notified of changes until they're explicitly removed again.

open fun addObserver(observer: TileStoreObserver)
computeCoveredArea
Link copied to clipboard

Computes a polygon of the area covered by the tiles cached in TileStore with the specified TilesetDescriptors.

open fun computeCoveredArea(descriptors: List<TilesetDescriptor>, callback: TileRegionGeometryCallback)
create
Link copied to clipboard

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.

open fun create(): TileStore

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](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information.

open fun create(path: String): TileStore
getAllTileRegions
Link copied to clipboard

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

open fun getAllTileRegions(callback: TileRegionsCallback)
getTileRegion
Link copied to clipboard

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

open fun getTileRegion(id: String, callback: TileRegionCallback)
getTileRegionGeometry
Link copied to clipboard

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. The actual regional geometry depends on the tiling scheme and might exceed the associated geometry. Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread; it is the responsibility of the user to dispatch to a user-controlled thread.

open fun getTileRegionGeometry(id: String, callback: TileRegionGeometryCallback)
getTileRegionMetadata
Link copied to clipboard

Returns a tile region's associated metadata The region's associated metadata that a user previously set for this region.

open fun getTileRegionMetadata(id: String, callback: TileRegionMetadataCallback)
loadTileRegion
Link copied to clipboard

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

open fun loadTileRegion(id: String, loadOptions: TileRegionLoadOptions): Cancelable

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

open fun loadTileRegion(id: String, loadOptions: TileRegionLoadOptions, onFinished: TileRegionCallback): Cancelable

Loads a new tile region or updates the existing one. Creating of a new region requires providing both geometry and tileset descriptors to the given load options, otherwise the load request fails with RegionNotFound error. If a tile region 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 tile region gets refreshed: the missing resources get loaded and the expired resources get updated. A failed load request can be reattempted with another loadTileRegion() call. If there is already a pending loading operation for the tile region with the given id the pending loading operation will fail with an error of Canceled type. Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread; it is the responsibility of the user to dispatch to a user-controlled thread.

open fun loadTileRegion(id: String, loadOptions: TileRegionLoadOptions, onProgress: TileRegionLoadProgressCallback, onFinished: TileRegionCallback): Cancelable
removeObserver
Link copied to clipboard

Removes an existing observer from the TileStore instance. If the observer isn't attached to the TileStore anymore, this is a no-op.

open fun removeObserver(observer: TileStoreObserver)
removeTileRegion
Link copied to clipboard

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.

open fun removeTileRegion(id: String)

An overloaded version with a callback for feedback. On successful tile region removal, the given callback is invoked with the removed tile region. Otherwise, the given callback is invoked with an error.

open fun removeTileRegion(id: String, callback: TileRegionCallback)
setOption
Link copied to clipboard

Sets additional options for this instance.

open fun setOption(key: String, value: Value)

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

open fun setOption(key: String, domain: TileDataDomain, value: Value)
tileRegionContainsDescriptors
Link copied to clipboard

Checks if a tile region with the given id contains all tilesets from all of the given tileset descriptors. Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread; it is the responsibility of the user to dispatch to a user-controlled thread.

open fun tileRegionContainsDescriptors(id: String, descriptors: List<TilesetDescriptor>, callback: TileRegionBooleanCallback)