SearchOfflineManager

public class SearchOfflineManager

OfflineManager handles TileStores and responsible for creating Search TilsetDescriptors

  • TileStore for offline tiles management. Use setTileStore method to change current tileStore.

    Declaration

    Swift

    public private(set) var tileStore: SearchTileStore { get }
  • Sets custom tile store. You can provide MapboxCommon.TileStore by wrapping it into MapboxSearch.SearchTileStore init(commonTileStore: CommonTileStore)

    Declaration

    Swift

    public func setTileStore(_ tileStore: SearchTileStore, completion: (() -> Void)? = nil)

    Parameters

    tileStore

    TileStore to set into SearchEngine

    completion

    this completion called right after SearchEngine finished consuming data from provided TileStore. One can start using offline search after that.

  • Sets custom tile store.

    Declaration

    Swift

    public func setTileStore(_ tileStore: MapboxCommon.TileStore, completion: (() -> Void)? = nil)

    Parameters

    tileStore

    TileStore to set into SearchEngine.

    completion

    this completion called right after SearchEngine finished consuming data from provided TileStore. One can start using offline search after that.

  • Undocumented

    Declaration

    Swift

    public func selectTileset(for dataset: String?, version: String? = nil)
  • Creates TilesetDescriptor for offline search index data with provided dataset name, version, and language. Providing nil or excluding the language parameter will use the dataset name as-is. Providing a language will append it to the name.

    Declaration

    Swift

    public static func createTilesetDescriptor(
        dataset: String,
        version: String? = nil,
        language: String? = nil
    ) -> MapboxCommon
    .TilesetDescriptor

    Parameters

    dataset

    dataset name

    version

    dataset version

    language

    Provide a ISO 639-1 Code language from NSLocale. Values will be appended to the place dataset name.

    Return Value

    TilesetDescriptor for TileStore

  • Creates TilesetDescriptor for offline search boundaries with provided dataset name and version. Providing nil or excluding the language parameter will use the places dataset name as-is. Providing a language will append it to the name.

    Declaration

    Swift

    public static func createPlacesTilesetDescriptor(
        dataset: String,
        version: String? = nil,
        language: String? = nil
    ) -> MapboxCommon
    .TilesetDescriptor

    Parameters

    dataset

    dataset name

    version

    dataset version

    language

    Provide a ISO 639-1 Code language from NSLocale. Values will be appended to the dataset name.

    Return Value

    TilesetDescriptor for TileStore

  • Creates TilesetDescriptor for offline search index data using default dataset name.

    Declaration

    Swift

    public static func createDefaultTilesetDescriptor() -> MapboxCommon.TilesetDescriptor

    Return Value

    TilesetDescriptor for TileStore

  • Creates TilesetDescriptor for offline search boundaries using default dataset name.

    Declaration

    Swift

    public static func createDefaultPlacesTilesetDescriptor() -> MapboxCommon.TilesetDescriptor

    Return Value

    TilesetDescriptor for TileStore