SearchOptions
public struct SearchOptions
Specifies fuzzy search options.
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(query:
geoBias: route: maxDetourDuration: sortOrder: limit: offset: searchAreas: locale: categoryIDs: openingHoursMode: countryCodes: brands: minPower: maxPower: fuelTypes: resultTypes: connectors: geopoliticalView: sessionID: ) Declaration
Swift
public init( query: String = "", geoBias: CLLocationCoordinate2D? = nil, route: [CLLocationCoordinate2D] = [], maxDetourDuration: Measurement<UnitDuration> = Measurement<UnitDuration>(value: 3600, unit: .seconds), sortOrder: SortOrder = .byDetourTime, limit: Int = 10, offset: Int? = nil, searchAreas: Geometry? = nil, locale: Locale = Locale.current, categoryIDs: Set<POICategoryID> = [], openingHoursMode: OpeningHoursMode? = nil, countryCodes: Set<String> = [], brands: Set<Brand> = [], minPower: Measurement<UnitPower>? = nil, maxPower: Measurement<UnitPower>? = nil, fuelTypes: Set<FuelType> = [], resultTypes: [SearchResultType] = [], connectors: Set<ConnectorType> = [], geopoliticalView: GeopoliticalView? = nil, sessionID: UUID? = nil )
Parameters
query
The search query.
geoBias
The position where results should be biased.
route
The route points.
maxDetourDuration
The maximum detour time. The maximum and default value is 3600 seconds. Detour time is the time added to the estimated time of arrival at the destination because of the change of route.
limit
The maximum number of search results that will be returned.
offset
The starting offset of the returned results within the full result set.
searchAreas
The geographic filter for search, all search results returned are confined in the specified geography.
locale
The language in which search results should be returned. If not specified, language is set to the default official language of the location of the result.
categories
Restricts the Points Of Interest in the response to those whose category ID is listed.
openingHoursMode
Scope of the opening hours to be provided.
countryCodes
A set of ISO 3166-1 alpha3 country codes. (e.g., FRA, ESP, USA). This will limit the search to the specified countries.
brands
A set of brands used to restrict the result to POIs associated with those brands.
minPower
The minimal power that a charging station can provide.
maxPower
The maximal power that a charging station can provide.
fuelTypes
A set of fuel types that a gas station can provide.
resultTypes
A set of
SearchResultType
to filter results.sessionID
A search session is a user session during which a user performs multiple search requests to find a specific address or point of interest. This is needed for sending feedback to the online search.
-
The search query.
Declaration
Swift
public var query: String
-
The position where results should be biased.
Declaration
Swift
public var geoBias: CLLocationCoordinate2D?
-
The maximum number of search results that will be returned. Defaults to 10.
Declaration
Swift
public var limit: Int
-
The starting offset of the returned results within the full result set.
Declaration
Swift
public var offset: Int?
-
The geographic filter for search, all search results returned are confined in the specified geography.
CircleGeometry
andRectangleGeomety
supportgeoBias
.CircleGeometry
center is also used asgeoBias
.PolygonGeometry
ignoresgeoBias
.Declaration
Swift
public var searchAreas: Geometry?
-
The route points.
Declaration
Swift
public let route: [CLLocationCoordinate2D]
-
The time added to the estimated time of arrival at the destination because of the change of route.
Note
The maximum value is 3600 seconds.Declaration
Swift
public let maxDetourDuration: Measurement<UnitDuration>
-
Defines how the results will be sorted.
Declaration
Swift
public let sortOrder: SortOrder
-
The language in which search results should be returned. If not specified, language is set to the default official language of the location of the result.
Declaration
Swift
public var locale: Locale
-
Restricts the Points Of Interest in the response to those whose category ID is listed.
Declaration
Swift
public var categoryIDs: Set<POICategoryID>
-
Scope of the opening hours to be provided.
Declaration
Swift
public var openingHoursMode: OpeningHoursMode?
-
A set of ISO 3166-1 alpha3 country codes. (e.g., FRA, ESP, USA). This will limit the search to the specified countries.
Declaration
Swift
public var countryCodes: Set<String>
-
A set of brands used to restrict the result to POIs associated with those brands.
Declaration
Swift
public var brands: Set<Brand>
-
The minimal power that a charging station can provide.
Declaration
Swift
public var minPower: Measurement<UnitPower>?
-
The maximal power that a charging station can provide.
Declaration
Swift
public var maxPower: Measurement<UnitPower>?
-
A set of fuel types that a gas station can provide.
Declaration
Swift
public var fuelTypes: Set<FuelType>
-
A list of
SearchResultType
to filter results.Declaration
Swift
public var resultTypes: [SearchResultType]
-
A list of connector types that a charging station supports. See https://developer.tomtom.com/search-api/search-api-documentation/supported-connector-types for more details.
Declaration
Swift
public var connectors: Set<ConnectorType>
-
Defines what kind of geopolitical view should be used.
Declaration
Swift
public var geopoliticalView: GeopoliticalView?
-
A search session is a user session during which a user performs multiple search requests to find a specific address or point of interest. This is needed for sending feedback to the online search.
Declaration
Swift
public var sessionID: UUID?