SearchInterface
public protocol SearchInterface : AnyObject
Provides the protocol for the online and offline search engines.
-
Performs an asynchronous text query search for
Placeinstances within a givenTextQuery.Area. The returned places are sorted by relevance.Declaration
Swift
@discardableResult func searchByText(_ query: TextQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandleParameters
queryDesired free-form text query to search.
optionsSearch options.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.
-
Performs an asynchronous address query search for
Placeinstances. This is the same type of search as forward geocoding, except that more data is returned than just the geographic coordinates of a given address. Note that an address can belong to more than onePlaceresult, although all found places will share the same geographic coordinates. The returned places are sorted by relevance.Declaration
Swift
@discardableResult func searchByAddress(_ query: AddressQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandleParameters
queryDesired free-form address query text to search.
optionsSearch options.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.
-
Performs an asynchronous category search for
Placeinstances. A list containing at least onePlaceCategorymust be provided as part of thesearchByCategory(...).query.Declaration
Swift
@discardableResult func searchByCategory(_ query: CategoryQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandleParameters
queryQuery with list of desired categories.
optionsSearch options.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.
-
Performs an asynchronous search for
Placeinstances based on the given geographic coordinates. This is the same search type as reverse geocoding, except that more data is returned than just theAddressrelated to the given coordinates. Note that more than onePlacecan be related to the given coordinates. The returned places are sorted by relevance.Declaration
Swift
@discardableResult func searchByCoordinates(_ coordinates: GeoCoordinates, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandleParameters
coordinatesThe coordinates where to search.
optionsSearch options.
completionCallback which receives result on the main thread.
Return Value
Handle that will be used to manipulate execution of the task.
-
Performs an asynchronous search for a
Placebased on its ID andLanguageCode.Declaration
Swift
@discardableResult func searchByPlaceId(_ query: PlaceIdQuery, languageCode: LanguageCode?, completion: @escaping PlaceIdSearchCompletionHandler) -> TaskHandleParameters
queryThe id of place to search.
languageCodeThe preferred language for the search results. When unset or unsupported language is chosen, results will be returned in their local language.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.
-
Performs an asynchronous search for a
Placebased on the content found inPickedPlace. IfPickedPlacedata is obtained from the offline map, it may happen that the newer version that is used by the online service represented bySearchEngineno longer contains the related POI. In that case,SearchError.noResultsFounderror is reported. When that happens, you may try to obtain the POI from the offline map by callingOfflineSearchEngine.searchByPickedPlace, only available for the Navigate license.Declaration
Swift
@discardableResult func searchByPickedPlace(_ pickedPlace: PickedPlace, languageCode: LanguageCode?, completion: @escaping PlaceIdSearchCompletionHandler) -> TaskHandleParameters
pickedPlaceThe content picked from map.
languageCodeThe preferred language for the search result. When unset or unsupported language is chosen, result will be returned in the local language.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.
-
Performs an asynchronous request to suggest places for text queries and returns suggestions sorted by relevance.
Note that while
OfflineSearchEngineincludes as many details as are available,SearchEngineincludes only the information that is relevant for autosuggest use cases. Complete details can be obtained by searching withPlaceIdQuery.Declaration
Swift
@discardableResult func suggestByText(_ query: TextQuery, options: SearchOptions, completion: @escaping SuggestCompletionHandler) -> TaskHandleParameters
queryDesired text query to search.
optionsSearch options.
completionCallback which receives the result on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.