OnlineSearch
@available(*, deprecated, message: " This API is deprecated and will be removed with the next major release. \n Please use OnlineSearchFactory instead.")
final public class OnlineSearch : Search
The Online Search API is a REST wrapper for a suite of web services that allow developers to use our scalable search engine.
-
OnlineSearch init method.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public convenience init(apiKey: String, customAPIURL: URL? = nil, geopoliticalView: String? = nil)Parameters
apiKeyA valid TomTom API Key.
customAPIURLCustom base URL for online APIs. Defaults to nil and TomTom online API base URL will be used. Can be used to change to another service that implements the same API.
geopoliticalViewThe country code in the ISO 3166-1 alpha-2 format whose view on disputed areas should be used. If not provided, or not supported, the international geopolitical view is used.
-
This API allows to search places and POIs meeting various criteria.
Declaration
Swift
public func search(options: SearchOptions, completion: @escaping (Result<SearchResponse, Error>) -> ()) -> CancellableParameters
optionsThe
SearchOptionsstructure to tune 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.Return Value
a
Cancellableinstance that provides control for request cancellation. -
This API provides a list of POI categories.
Declaration
Swift
public func requestPOICategories( options: POICategoryOptions, completion: @escaping (Result<POICategoryResponse, Error>) -> () ) -> CancellableParameters
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.Return Value
a
Cancellableinstance that provides control for request cancellation. -
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<AutocompleteResponse, Error>) -> () ) -> CancellableParameters
optionsThe
AutocompleteOptionsstructure to filter 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.Return Value
a
Cancellableinstance that provides control for request cancellation. -
This API provides detailed information about a place based on its identifier (entityId).
Declaration
Swift
public func requestPOIDetails( options: POIDetailsOptions, completion: @escaping (Result<POIDetailsResponse, Error>) -> () ) -> CancellableParameters
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.Return Value
a
Cancellableinstance that provides control for request cancellation. -
The Geometries 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.
- options: Defines geometries to request.
- completion: Parameter 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
Declaration
Swift
public func requestGeometryData( options: GeometryDataOptions, completion: @escaping (Result<GeometryDataResponse, Error>) -> () ) -> CancellableReturn Value
a
Cancellableinstance that provides control for request cancellation. -
Asynchronously sends a feedback event for the search.
Declaration
Swift
public func sendFeedback(feedbackEvent: FeedbackEvent, completion: ((Error?) -> ())? = nil) -> CancellableParameters
feedbackEventThe feedback event.
completionIf an error occurred,
completionis called with error.Return Value
a
Cancellableinstance that provides control for request cancellation. -
This method provides the capability to search EV charging stations meeting various criteria.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func evSearch(options: EVSearchOptions, completion: @escaping (Result<EVSearchResponse, Error>) -> ()) -> CancellableParameters
optionsThe
EVSearchOptionsstructure to limit the results.completionThe completion closure is called after the request response is processed. If no errors occurred,
EVSearchResponsecontains an array of search results. If cancellation is triggered, the completion returns a cancellation error.Return Value
a
Cancellableinstance that provides control for request cancellation.
TomTom SDK for iOS (0.53.1)
OnlineSearch