FavoriteRecord
public struct FavoriteRecord : IndexableRecord, SearchResult, Codable, Equatable
Resolved search result intended to represent user favorites
-
Unique record identifier.
Declaration
Swift
public let id: String -
Displayable name of the record.
Declaration
Swift
public var name: String -
A unique identifier for the geographic feature
Declaration
Swift
public var mapboxId: String? -
The feature name, as matched by the search algorithm. Not available in
searchBoxresults.Warning
The field is exposed for compatibility only and should be considered deprecated.Declaration
Swift
public var matchingName: String? -
address formatted with medium style.
Declaration
Swift
public var descriptionText: String? -
Coordinate associated to the favorite record.
Declaration
Swift
public internal(set) var coordinate: CLLocationCoordinate2D { get set } -
An approximate distance to the origin location, in meters.
Declaration
Swift
public var distance: CLLocationDistance? -
Result address.
Declaration
Swift
public var address: Address? -
Maki icon name.
Declaration
Swift
public var icon: Maki? -
Index in response from server.
Declaration
Swift
public let serverIndex: Int? -
A point accuracy metric for the returned address.
Declaration
Swift
public let accuracy: SearchResultAccuracy? -
Maki icon name. Use
iconwhen possible.Declaration
Swift
public var iconName: String? -
Declaration
Swift
public var makiIcon: String? { get } -
Result categories types.
Declaration
Swift
public var categories: [String]? -
Coordinates of building entries
Declaration
Swift
public var routablePoints: [RoutablePoint]? -
Type of SearchResult. Should be one of address or POI.
Declaration
Swift
public var type: SearchResultType -
Additional string literals that should be included in object index. For example, you may provide non-official names to force
SearchEnginematch them.Declaration
Swift
public var additionalTokens: Set<String>? -
FavoriteRecord Always has estimatedTime as nil.
Declaration
Swift
public var estimatedTime: Measurement<UnitDuration>? -
Original search request.
Declaration
Swift
public let searchRequest: SearchRequestOptions -
Associated metadata
Declaration
Swift
public var metadata: SearchResultMetadata? -
init(id:mapboxId:name:matchingName:coordinate:distance:address:makiIcon:serverIndex:accuracy:categories:routablePoints:resultType:searchRequest:metadata:descriptionText:)Favorite record constructor
Declaration
Swift
public init( id: String? = nil, mapboxId: String? = nil, name: String, matchingName: String?, coordinate: CLLocationCoordinate2D, distance: CLLocationDistance? = nil, address: Address?, makiIcon: Maki?, serverIndex: Int?, accuracy: SearchResultAccuracy?, categories: [String]?, routablePoints: [RoutablePoint]? = nil, resultType: SearchResultType, searchRequest: SearchRequestOptions, metadata: SearchResultMetadata? = nil, descriptionText: String? = nil )Parameters
idUUID used by default
mapboxIdUnique record identifier
nameFavorite name
matchingNameThe feature name, as matched by the search algorithm
coordinateFavorite coordinate
distanceAn approximate distance to the origin location, in meters
addressFavorite address
makiIconFavorite icon name
serverIndexThe index in response from server
accuracyA point accuracy metric for the returned address
categoriesFavorite categories list
routablePointsCoordinates of building entries
searchRequestoriginal search request
metadataAssociated metadata
resultTypeFavorite result type
descriptionTextAddress formatted with the medium style
-
Build Favorite record from SearchResult
Declaration
Swift
public init( id: String? = nil, name: String, searchResult: SearchResult )Parameters
idUUID used by default
nameFavorite name
searchResultsearch result to use for FavoriteRecord
FavoriteRecord Structure Reference