HistoryRecord
public struct HistoryRecord : IndexableRecord, SearchResult, Codable, Hashable
Resolved search result intended to represent user search history
-
“history icon” by default
Declaration
Swift
public var iconName: String? -
Declaration
Swift
public var makiIcon: String? { get } -
Type of stored history record
See moreDeclaration
Swift
public enum HistoryType : Int, Codable -
Unique identifier
Declaration
Swift
public private(set) var id: String { get } -
Declaration
Swift
public private(set) var mapboxId: String? { get } -
Record’s name
Declaration
Swift
public private(set) var name: String { get } -
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? -
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 private(set) var matchingName: String? { get } -
Address formatted with medium style
Declaration
Swift
public var descriptionText: String? -
Coordinate associated with the 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? -
The time when the record was created.
Declaration
Swift
public private(set) var timestamp: Date { get } -
Type of object used to make a history record, e.g. result or query
Declaration
Swift
public private(set) var historyType: HistoryType { get } -
Original result type of object, e.g. address or POI
Declaration
Swift
public private(set) var type: SearchResultType { get } -
FavoriteRecord Always has estimatedTime as nil.
Declaration
Swift
public var estimatedTime: Measurement<UnitDuration>? -
Associated metadata at creating time if available.
Declaration
Swift
public var metadata: SearchResultMetadata? -
Address components of specific record
Declaration
Swift
public var address: Address? -
Additional indexable tokens for search engine
SearchEngine would track that tokens to match results
Declaration
Swift
public var additionalTokens: Set<String>? -
POI categories associated with the original result
Declaration
Swift
public var categories: [String]? -
Canonical POI category IDs associated with the original result
Declaration
Swift
public var categoryIds: [String]? -
Original search request.
Declaration
Swift
public let searchRequest: SearchRequestOptions -
Coordinates of building entries
Declaration
Swift
public var routablePoints: [RoutablePoint]? -
Optional bounding box that represents the geographical boundaries of a location, e.g., a building.
Declaration
Swift
public let boundingBox: BoundingBox? -
init(id:mapboxId:name:matchingName:serverIndex:accuracy:coordinate:distance:timestamp:historyType:type:address:metadata:categories:categoryIds:searchRequest:routablePoints:descriptionText:boundingBox:)History record constructor
Declaration
Swift
public init( id: String = UUID().uuidString, mapboxId: String?, name: String, matchingName: String?, serverIndex: Int?, accuracy: SearchResultAccuracy?, coordinate: CLLocationCoordinate2D, distance: CLLocationDistance? = nil, timestamp: Date = Date(), historyType: HistoryRecord.HistoryType, type: SearchResultType, address: Address?, metadata: SearchResultMetadata? = nil, categories: [String]? = nil, categoryIds: [String]? = nil, searchRequest: SearchRequestOptions, routablePoints: [RoutablePoint]? = nil, descriptionText: String? = nil, boundingBox: BoundingBox? = nil )Parameters
idUUID used by default
mapboxIdUnique record identifier
nameHistory name
matchingNameThe feature name, as matched by the search algorithm
serverIndexThe index in response from server
accuracyA point accuracy metric for the returned address
coordinateHistory coordinate
distanceAn approximate distance to the origin location, in meters
timestampHistory timestamp
historyTypeHistory type
typeHistory type
addressHistory address
metadataAssociated metadata
categoriesCategories of original object
categoryIdsCategory IDs of original object
searchRequestThe original search request
routablePointsCoordinates of building entries
descriptionTextAddress formatted with the medium style
boundingBoxBounding box that represents the geographical boundaries of a location
-
Construct
HistoryRecordbased on concreteSearchResultDeclaration
Swift
public init( historyType: HistoryRecord.HistoryType = .result, searchResult: SearchResult, timestamp: Date = Date() )Parameters
historyTypeType of history result
searchResultPrototype result
timestampcreating timestamp. Calling time by default
HistoryRecord Structure Reference