OfflineSearchEngine

interface OfflineSearchEngine

The OfflineSearchEngine interface provides forward and reverse geocoding search that works offline. An instance of the OfflineSearchEngine can be obtained with MapboxSearchSdk.getOfflineSearchEngine.

Offline forward geocoding search works in a two-step manner, see SearchEngine for more details.

The API of this class is temporary and subject to change. Tiles loading functionality is available to selected customers only. Contact our team, to get early preview.

Types

AddRegionCallback
Link copied to clipboard
interface AddRegionCallback
Interface definition for a callback to be invoked when the offline region has been added to the engine.
EngineReadyCallback
Link copied to clipboard
interface EngineReadyCallback
Interface definition for a callback to be invoked when the OfflineSearchEngine is ready for use.

Functions

addEngineReadyCallback
Link copied to clipboard
open fun addEngineReadyCallback(callback: OfflineSearchEngine.EngineReadyCallback)
Adds a callback to be notified when engine is ready.
abstract fun addEngineReadyCallback(executor: Executor, callback: OfflineSearchEngine.EngineReadyCallback)
Adds a callback to be notified when engine is ready.
addOfflineRegion
Link copied to clipboard
open fun addOfflineRegion(path: String, mapsFileNames: List<String>, boundaryFileName: String, callback: OfflineSearchEngine.AddRegionCallback): AsyncOperationTask
Register offline region data for search index.
abstract fun addOfflineRegion(path: String, mapsFileNames: List<String>, boundaryFileName: String, executor: Executor, callback: OfflineSearchEngine.AddRegionCallback): AsyncOperationTask
Register offline region data for search index.
getGroupInfo
Link copied to clipboard
open fun getGroupInfo(groupId: String, callback: CompletionCallback<TileRegion>): AsyncOperationTask
Provides group meta info represented by TileRegion.
abstract fun getGroupInfo(groupId: String, executor: Executor, callback: CompletionCallback<TileRegion>): AsyncOperationTask
Provides group meta info represented by TileRegion.
getTileRegions
Link copied to clipboard
open fun getTileRegions(callback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Returns a list of previously downloaded tile regions.
abstract fun getTileRegions(executor: Executor, callback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Returns a list of previously downloaded tile regions.
loadTileRegion
Link copied to clipboard
open fun loadTileRegion(groupId: String, geometry: Geometry, progressCallback: TileRegionLoadProgressCallback, completionCallback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Loads a new download region or updates the existing one.
abstract fun loadTileRegion(groupId: String, geometry: Geometry, executor: Executor, progressCallback: TileRegionLoadProgressCallback, completionCallback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Loads a new download region or updates the existing one.
removeEngineReadyCallback
Link copied to clipboard
abstract fun removeEngineReadyCallback(callback: OfflineSearchEngine.EngineReadyCallback)
Removes a previously added callback.
removeTilesGroup
Link copied to clipboard
open fun removeTilesGroup(groupId: String, callback: CompletionCallback<Unit>): AsyncOperationTask
Removes group of tiles.
abstract fun removeTilesGroup(groupId: String, executor: Executor, callback: CompletionCallback<Unit>): AsyncOperationTask
Removes group of tiles.
reverseGeocoding
Link copied to clipboard
open fun reverseGeocoding(options: OfflineReverseGeoOptions, callback: SearchCallback): SearchRequestTask
Performs reverse geocoding.
abstract fun reverseGeocoding(options: OfflineReverseGeoOptions, executor: Executor, callback: SearchCallback): SearchRequestTask
Performs reverse geocoding.
search
Link copied to clipboard
open fun search(query: String, options: OfflineSearchOptions, callback: SearchSuggestionsCallback): SearchRequestTask
The first step of the offline forward geocoding.
abstract fun search(query: String, options: OfflineSearchOptions, executor: Executor, callback: SearchSuggestionsCallback): SearchRequestTask
The first step of the offline forward geocoding.
searchAddressesNearby
Link copied to clipboard
open fun searchAddressesNearby(street: String, proximity: Point, radiusMeters: Double, callback: SearchCallback): SearchRequestTask
Searches for addresses nearby (around proximity point), matched with specified street name.
abstract fun searchAddressesNearby(street: String, proximity: Point, radiusMeters: Double, executor: Executor, callback: SearchCallback): SearchRequestTask
Searches for addresses nearby (around proximity point), matched with specified street name.
select
Link copied to clipboard
open fun select(suggestion: SearchSuggestion, callback: SearchSelectionCallback): SearchRequestTask
The second step of the offline forward geocoding.
abstract fun select(suggestion: SearchSuggestion, executor: Executor, callback: SearchSelectionCallback): SearchRequestTask
The second step of the offline forward geocoding.
updateTilesGroup
Link copied to clipboard
open fun updateTilesGroup(groupId: String, progressCallback: TileRegionLoadProgressCallback, completionCallback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Updates the existing group of tiles.
abstract fun updateTilesGroup(groupId: String, executor: Executor, progressCallback: TileRegionLoadProgressCallback, completionCallback: CompletionCallback<List<OfflineTileRegion>>): AsyncOperationTask
Updates the existing group of tiles.