SearchService
public protocol SearchService
Search Service API.
Important
This is a Public Preview API. It may be changed or removed at any time.-
This service provides the capability to search places and POIs meeting various criteria.
Declaration
Swift
func search(query: SearchQuery, completion: @escaping (Result<SearchResponse, Error>) -> ())Parameters
queryThe
SearchQueryobject 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. -
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
func autocompleteSearch(query: AutocompleteQuery, completion: @escaping (Result<AutocompleteResponse, Error>) -> ())Parameters
queryThe
AutocompleteQuery.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 service allows you to perform a fuzzy search for POIs along a specified route.
Declaration
Swift
func searchAlongRoute(query: AlongRouteQuery, completion: @escaping (Result<SearchResponse, Error>) -> ())Parameters
queryThe
AlongRouteQuery. Query can be made usingAlongRouteQueryBuilder.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
SearchResponsecontains an array of search result and summary information. -
This service provides a full list of POI categories and subcategories together with their translations and synonyms. Additional POI category parameters like language can be taken into account using the
PoiCategoryQuery.Declaration
Swift
func requestPoiCategories(query: PoiCategoryQuery, completion: @escaping (Result<PoiCategoryResponse, Error>) -> ())Parameters
queryThe
PoiCategoryQuery.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. -
Provides detailed information about a POI based on its identifier (entityId).
Declaration
Swift
func requestPOIDetails( query: POIDetailsQuery, completion: @escaping (Result<TomTomSDKSearch.POIDetailsResponse, Error>) -> () )Parameters
querya query to describe 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 the requested search result with POI info -
The Geometries Data Provider returns sets of coordinates that represent the outline of a city, country, or land area. The service supports batch requests of up to 20 identifiers.
- query: The query that 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
func requestGeometryData(query: GeometryDataQuery, completion: @escaping (Result<GeometryDataResponse, Error>) -> ()) -
The EV Charging Stations Availability endpoint provides information about the current availability of charging points, grouped by connector type and then power level. The response can be filtered by connector type and a range of charging powers, if provided (using optional request parameters).
Declaration
Swift
func requestEvChargingStationsAvailability( query: EVChargingStationsAvailabilityQuery, completion: @escaping (Result<EVChargingStationsAvailabilityResponse, Error>) -> () )Parameters
queryThe
EVChargingStationsAvailabilityQuery. Can be made usingEVChargingStationsAvailabilityQueryBuilder.completionParameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred,
SearchResponsecontains an array of categories and subcategories together with their translations and synonyms.
SearchService Protocol Reference