OfflineSearch
public final class OfflineSearch : Search
The Offline Search API provides several types of search using an offline map.
-
Creates a new
OfflineSearchinstance.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init(store: NDSStore) throwsParameters
storea
NDSStoreproviding access to the offline map.customPOIDataProvidersCustom data providers for injecting external POI data into the search engine.
-
OfflineSearch init method.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init(store: NDSStore, customPOIDataProviders: [CustomPOISearchDataProvider] = []) throwsParameters
storea
NDSStoreproviding access to the offline map.customPOIDataProvidersCustom data providers for injecting external POI data into the search engine.
-
Errors that may occur while doing offline search.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
-
This API allows to search places and POIs meeting various criteria.
Declaration
Swift
public func search( options: SearchOptions, completion: @escaping (Result<TomTomSDKSearch.SearchResponse, Error>) -> () )Parameters
optionsThe
SearchOptionsstructure to limit the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
SearchResponsecontains an array of search results and summary information. -
This API provides a list of POI categories.
Declaration
Swift
public func requestPOICategories( options: POICategoryOptions, completion: @escaping (Result<POICategoryResponse, Error>) -> () )Parameters
optionsThe
POICategoryOptionsstructure to tune the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
POICategoryResponsecontains an array of categories and subcategories together with their translations and synonyms. -
The Autocomplete API enables you to make a more meaningful Search API call by recognizing entities inside an input query and offering them as query terms.
Declaration
Swift
public func autocomplete( options: AutocompleteOptions, completion: @escaping (Result<TomTomSDKSearch.AutocompleteResponse, Error>) -> () )Parameters
optionsThe
AutocompleteOptionsstructure to limit the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
AutocompleteResponsecontains proposed autocomplete elements, that can be used to implement an input field with the autocomplete feature. -
This API provides detailed information about a place based on its identifier (entityId).
Declaration
Swift
public func requestPOIDetails( options: POIDetailsOptions, completion: @escaping (Result<TomTomSDKSearch.POIDetailsResponse, Error>) -> () )Parameters
optionsDescribes what POI Details data to request.
completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
POIDetailsResponsecontains a search result associated with the requested POI. -
The Geometry Data API returns sets of coordinates that represent the outline of a city, country, or land area. The API supports batch requests of up to 20 identifiers.
Note
This API is not supported for offline search so far.Declaration
Swift
public func requestGeometryData( options: GeometryDataOptions, completion: @escaping (Result<GeometryDataResponse, Error>) -> () )Parameters
optionsThe structure that defines geometries to request.
completionParameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred,
GeometryDataResponsecontains an array of geometries data structures -
Asynchronously sends a feedback event for the search.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func sendFeedback(feedbackEvent: TomTomSDKSearch.FeedbackEvent, completion: ((Error?) -> ())? = nil)Parameters
feedbackEventThe feedback event.
completionIf an error occurred,
completionis called with error.
OfflineSearch Class Reference