SearchTileStore
public class SearchTileStore
Simple wrapper for MapboxCommon.TileStore
.
This instance provides basic
TileStore` functionality for a rare case when
someone using Offline search without other Mapbox frameworks.
Use commonTileStore
property to access underlaying MapboxCommon.TileStore
-
Default API Url used for
Search
tile data domain.Declaration
Swift
public let defaultEndPoint: String
-
Underlaying TileStore from MapboxCommon framework for use across Mapbox frameworks.
Declaration
Swift
public private(set) var commonTileStore: MapboxCommon.TileStore { get }
-
Creates with shared
MapboxCommon.TileStore
instance at the default location. Creates a newMapboxCommon.TileStore
if one doesn’t yet exist.Declaration
Swift
public init()
-
Creates with custom CommonTileStore.
Declaration
Swift
public init(commonTileStore: MapboxCommon.TileStore)
Parameters
commonTileStore
SearchEngine will start using provided TileStore
-
Creates with shared
MapboxCommon.TileStore
instance for the given storage path. Creates a newMapboxCommon.TileStore
if one doesn’t yet exist. If the given path is empty, the tile store at the default location is returned.Declaration
Swift
public init(path: String)
Parameters
path
The path on disk where tiles and metadata will be stored.
-
Loads a new tile region or updates the existing one.
Declaration
Swift
public func loadTileRegion(id: String, options: MapboxCommon.TileRegionLoadOptions)
Parameters
id
The tile region identifier.
options
The tile region load options.
-
Loads a new tile region or updates the existing one.
Declaration
Swift
public func loadTileRegion( id: String, options: MapboxCommon.TileRegionLoadOptions, progress: MapboxCommon.TileRegionLoadProgressCallback? = nil, completion: ((Result<MapboxCommon.TileRegion, TileRegionError>) -> Void)? ) -> SearchCancelable
Parameters
id
The tile region identifier.
options
The tile region load options.
progress
Invoked multiple times to report progress of the loading operation. Optional, default is nil.
completion
Invoked only once upon success, failure, or cancelation of the loading operation. Any
Result
error could be of typeTileRegionError
.Return Value
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
Swift
public func removeTileRegion(id: String)
Parameters
id
The tile region identifier.
-
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
Swift
public func removeTileRegion( id: String, completion: ((Result<MapboxCommon.TileRegion, TileRegionError>) -> Void)? )
Parameters
id
The tile region identifier.
completion
Completion with
Result
, error could be of typeTileRegionError
.