Structures
The following structures are available globally.
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct DestinationArrivalStatus
-
Holds arrival status to a unique waypoint.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct WaypointArrivalStatus
-
Guidance announcement relating to a maneuver during navigation. The announcement text message is provided in both Speech Synthesis Markup Language (SSML) and plain-text formats.
See moreDeclaration
Swift
public struct GuidanceAnnouncement : Equatable
-
Guidance update provided while navigating a route, including the list of upcoming instructions, guidance announcement and distance to the next maneuver.
See moreDeclaration
Swift
public struct Guidance
-
Guidance Instruction indicating arrival at the destination.
See moreDeclaration
Swift
public struct ArrivalGuidanceInstruction : GuidanceInstruction
-
Indicates a border crossing between two countries.
See moreDeclaration
Swift
public struct BorderCrossing
-
Instruction indicating an upcoming border crossing.
See moreDeclaration
Swift
public struct BorderCrossingGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating departure from the origin.
See moreDeclaration
Swift
public struct DepartureGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating entering a vehicle transportation service through a terminal.
See moreDeclaration
Swift
public struct EnterAutoTransportGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating entering a carpool lane by changing lanes.
See moreDeclaration
Swift
public struct EnterCarpoolLaneGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating exiting a vehicle transportation service through a terminal.
See moreDeclaration
Swift
public struct ExitAutoTransportGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating exiting a carpool lane by changing lanes.
See moreDeclaration
Swift
public struct ExitCarpoolLaneGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating taking a highway exit.
See moreDeclaration
Swift
public struct ExitHighwayGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating an exit from a roundabout.
See moreDeclaration
Swift
public struct ExitRoundaboutGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating that the current road should be followed for some distance.
See moreDeclaration
Swift
public struct FollowGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating an upcoming fork in the road.
See moreDeclaration
Swift
public struct ForkGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating a turn which is legally required.
See moreDeclaration
Swift
public struct MandatoryTurnGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating a merge onto another road.
See moreDeclaration
Swift
public struct MergeGuidanceInstruction : GuidanceInstruction
-
Road information relating to a
See moreGuidanceInstruction
.Declaration
Swift
public struct Road : Equatable
-
Guidance Instruction indicating an upcoming roundabout.
See moreDeclaration
Swift
public struct RoundaboutGuidanceInstruction : GuidanceInstruction
-
Contains information about the signpost for the
See moreGuidanceInstruction
.Declaration
Swift
public struct Signpost : Equatable
-
Guidance Instruction indicating changing highways by following an exit ramp.
See moreDeclaration
Swift
public struct SwitchHighwayGuidanceInstruction : GuidanceInstruction
-
Guidance instruction indicating the driver is approaching a tollgate or ETC terminal.
See moreDeclaration
Swift
public struct TollgateGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating the driver should turn around when it is possible.
See moreDeclaration
Swift
public struct TurnAroundWhenPossibleGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating a turn at a road junction.
See moreDeclaration
Swift
public struct TurnGuidanceInstruction : GuidanceInstruction
-
Guidance Instruction indicating that a waypoint on the route is reached.
See moreDeclaration
Swift
public struct WaypointGuidanceInstruction : GuidanceInstruction
-
Contains information about lane guidance.
Lanes are stored in order from curb side to middle side. That is, in left-hand driving locales such as Japan, the lanes are ordered from left to right, while in right-hand driving locales such as the USA, the lanes are ordered from right to left.
See moreDeclaration
Swift
public struct LaneGuidance
-
Holds information about
See moreLaneGuidance
and whether it is starting or ending.Declaration
Swift
public struct LaneGuidanceUpdate
-
Location context contains detailed information about the current location during navigating.
To retrieve location context:
- implement the
NavigationLocationContextObserver
protocol - register the observer using the
TomTomNavigation.addLocationContextObserver(_:)
method of the initializedTomTomNavigation
object After navigation has started (with or without a route), you will receiveLocationContext
via theNavigationLocationContextObserver.didDetectLocationContext(locationContext:)
method. “`
class NavigationLocationContextObserverImpl : NavigationLocationContextObserver { override func didDetectLocationContext(locationContext: LocationContext) {} }
private let navigationLocationContextObserver = NavigationLocationContextObserverImpl() … tomTomNavigation.addLocationContextObserver(navigationLocationContextObserver)
See moreDeclaration
Swift
public struct LocationContext : Equatable
- implement the
-
The MapMatchingResult provides information about the matched location and its details.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct MapMatchingResult
-
The RouteProgress class provides information about the driver’s progress along the route.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RouteProgress
-
Represents current progress along the route till given
See moreTomTomSDKRoute/RouteStop
.Declaration
Swift
public struct RouteStopProgress
-
Represents a projected route with missing map reference data.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct ProjectedRoute
-
Describes part of the
ProjectedRoute
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct ProjectedRouteSection
-
ActiveRouteData
stores the active route and an optional better route proposal.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct ActiveRouteData
-
Navigation snapshot containing information about the state of the trip at a certain moment
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct NavigationSnapshot
-
Represents the tracking states for followed and unfollowed routes within the
NavigationSession
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RouteTrackingState
-
Represents the routes that are not currently followed (unfollowed) within the
NavigationSession
. An unfollowed route comprises aRoute
within theNavigationSession
that is not currently followed and a back-to-route point. This is the closest point on the route to the current location.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct UnfollowedRoute
-
Keeps the state of the waypoints in the current route, providing methods to change the state (as necessary).
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RouteWaypointsState
-
Route plan defines parameters required for a single route in navigation session.
To specify a route plan, first plan a
TomTomSDKRoute/Route
usingTomTomSDKRoutePlanner/RoutePlanner
andTomTomSDKRoutePlanner/RoutePlanningOptions
.For more information on navigation session see
See moreTomTomNavigation/start()
,TomTomNavigation/start(_:)
,TomTomNavigation/update(_:)
andTomTomNavigation/stop()
.Declaration
Swift
public struct RoutePlan
-
HorizonElement
that contains data about a city.To receive such elements in the horizon snapshot
HorizonSnapshot
, specifyHorizonElementType
.cityType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.cityType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct CityElement : HorizonElement
-
HorizonElement
that contains data about a country.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.countryInformationType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.countryInformationType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct CountryInformationElement : HorizonElement
-
SpeedLimit
that is specific to a region in a country.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RegionalSpeedLimit : Equatable
-
HorizonElement
that contains data about a dangerous goods restriction.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.dangerousGoodsRestrictionType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.dangerousGoodsRestrictionType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct DangerousGoodsRestrictionElement : HorizonElement
-
HorizonElement
that contains data about general road properties.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.generalRoadPropertiesType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.cityType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct GeneralRoadPropertiesElement : HorizonElement
-
Describes path geometry of the
HorizonElement
.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.pathGeometryType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.pathGeometryType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct PathGeometryElement : HorizonElement
-
HorizonElement
that contains data about a region.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.regionType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.regionType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RegionElement : HorizonElement
-
HorizonElement
that contains data about a safety location.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.safetyLocationType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.safetyLocationType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct SafetyLocationElement : HorizonElement
-
HorizonElement
that contains data about a speed limit.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.speedLimitType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.speedLimitType], ... )
Attention
speed limits are affected mostly by
TomTomSDKCommon.VehicleType
, but apart from the vehicle type, some other vehicle characteristics might be considered, such as weight, type of load, and many others.Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public struct SpeedLimitElement : HorizonElement, Equatable
-
HorizonElement
that contains data about a street.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.streetType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.streetType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct StreetElement : HorizonElement
-
HorizonElement
that contains data about a traffic sign.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.trafficSignType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.trafficSignType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct TrafficSignElement : HorizonElement
-
HorizonElement
that contains data about a vehicle restriction.To receive such elements in the
HorizonSnapshot
, specifyHorizonElementType
.vehicleRestrictionType in theHorizonOptions
that you register with theHorizonEngine
:let horizonOptions = HorizonOptions( id: UUID(), elementTypes: [.vehicleRestrictionType], ... )
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct VehicleRestrictionElement : HorizonElement
-
Policy that defines a search distance for the main path.
The main path is the path the user currently follows, extending along the most likely trajectory. If the horizon options specify this policy, the
HorizonEngine
only searches within an explicitly specified distance when extending the main path.For more information on horizon paths see
HorizonEngine
.For more information on horizon options see
HorizonOptions
.To search along the entire route use the
RouteLengthPolicy
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct ExplicitDistancePolicy : PathSearchDistancePolicy
-
Output of the
HorizonEngine
.Entry of horizon result is consisted of one
HorizonSnapshot
,HorizonPosition
and set of previously registeredHorizonOptions
.HorizonSnapshot
holds current snapshot of horizon which includes available paths, status of the horizon snapshot and ID of the main path. Horizon result additionally containsHorizonOptions
provided by user andHorizonPosition
representing current position. BothHorizonOptions
andHorizonPosition
determine contents of theHorizonSnapshot
.Horizon results can be obtained by creating instance of
HorizonEngine
, registering desiredHorizonOptions
with callHorizonEngine
.registerHorizonOptions
and making direct request to generate horizonHorizonEngine
.generateHorizon
providingHorizonOptions
and currentNavigationSnapshot
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonResult
-
Horizon configuration options.
Horizon options define the extent of the
HorizonPath
in the horizon and the map attributes to be collected for these paths. A set of horizon options consists of the following:- The set of
HorizonElementType
the client is interested in. - The path search options for the main path.
- The path search options for sub-paths.
- The maximum number of paths the client can receive.
- Minimum length of the horizon ahead for which a horizon snapshot update is triggered.
To specify horizon options, create an instance of this class:
let mainPathSearchOptions = try MainPathSearchOptions( searchTime: .tt.minutes(10), searchDistancePolicy: ExplicitDistancePolicy( searchDistance: PathSearchDistance( maxHorizonLength: .tt.kilometers(5) ) ), minDistanceAhead: .tt.kilometers(1.5) ) let subPathSearchOptionsLevel1 = try SubPathSearchOptions( searchTime: .tt.minutes(5), searchDistance: PathSearchDistance( maxHorizonLength: .tt.kilometers(2) ) ) let subPathSearchOptionsLevel2 = try SubPathSearchOptions( searchTime: .tt.minutes(3), searchDistance: PathSearchDistance( maxHorizonLength: .tt.kilometers(1) ) ) let horizonOptions = try HorizonOptions( id: UUID(), elementTypes: [.speedLimitsType, .regionType], mainPathSearchOptions: mainPathSearchOptions, subPathSearchOptions: [subPathSearchOptionsLevel1, subPathSearchOptionsLevel2], numberOfPaths: 4 )
For more information on horizon element types and horizon paths see
HorizonEngine
.A client application can register multiple sets of horizon options and request the engine to provide data for all or only some of the registered option sets. The engine generates a separate
HorizonResult
for each set of options in the request. The client can also update horizon configuration by registering a new set of options or unregistering a previously registered set.To register a set of horizon options, call the
HorizonEngine
.registerHorizonOptions
function.To unregister a set of horizon options, call the
HorizonEngine
.unregisterHorizonOptions
function.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonOptions
extension HorizonOptions: Hashable
- The set of
-
Defines the interface to horizon element types.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonElementType : RawRepresentable, Hashable
-
Horizon search options for the main path.
These options specify the
PathSearchDistancePolicy
and the search time for the main path. The main path is the path the user currently follows, extending along the most likely trajectory. The search distance policy and the search time define the extent of the main path.To specify horizon options for the main path, create an instance of this class:
let mainPathSearchOptions = try MainPathSearchOptions( searchTime: .tt.minutes(10), searchDistancePolicy: ExplicitDistancePolicy( searchDistance: PathSearchDistance( maxHorizonLength: .tt.kilometers(5) ) ), minDistanceAhead: .tt.kilometers(1.5) )
For more information on horizon paths see
HorizonEngine
.For more information on horizon options see
HorizonOptions
.The
PathSearchDistancePolicy
determines whether the horizon engine must search along the entire route (seeRouteLengthPolicy
) or within an explicitly specified distance (seeExplicitDistancePolicy
).If both search time and search distance policy are provided (i.e., the options specify both a search time and a search distance policy) for the main path, the
HorizonEngine
extends the main path until time and distance have both reached their limits. If the search time is not specified, the horizon engine works with a default value ofDefaults
.pathSearchTime
for the search time and extends the main path based on the search distance directly specified by or derived from the search policy.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct MainPathSearchOptions
-
Horizon search options for a sub-path level.
These options specify the search distance and the search time for a sub-path level. The level of a sub-path is the number of times the user would have to deviate, starting from the main path, in order to reach that sub-path. The search distance and the search time define the extent of sub-paths of that level in the horizon.
To specify options for a sub-path level, create an instance of this class:
let subPathSearchOptionsLevel1 = try SubPathSearchOptions( searchTime: .tt.minutes(5), searchDistance: PathSearchDistance( maxHorizonLength: .tt.kilometers(2) ) )
For more information on horizon paths see
HorizonEngine
.For more information on horizon options see
HorizonOptions
.If both search time and search distance are specified (i.e., the options specify both a search time and a search distance) for a given sub-path level, the
HorizonEngine
extends horizon sub-paths of that level until both time and distance have reached the limit. If only the search distance is specified for a given sub-path level, the horizon engine works with a default valueDefaults
.pathSearchTime
for the search time and extends the sub-paths of that level based on the search distance. If only the search time is specified for a given sub-path level, the horizon engine works with a default value ofDefaults
.pathSearchDistance
maximum extension length for the search distance and extends sub-paths of that level until both time and distance reach the limit.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct SubPathSearchOptions
-
Snapshot of the horizon.
Snapshot of the horizon provided by the
HorizonEngine
for a set of registeredHorizonOptions
. These options define the extent of the pathsHorizonPath
on the horizon and which map attributes are collected for those paths.Horizon snapshot holds state of the horizon for
HorizonOptions
provided by user and current position. Snapshot contains data such as:- paths: List of horizon paths
HorizonPath
, consisting of the main path and zero or more sub-paths. The main path is the path on which the likeliest map-matched on-road position is located. If there is no on-road map-matched position candidate, there is no main path either. This is because no horizon can be provided if there is no on-road map-matched position. SeeHorizonPosition
for more details. A sub-path is any path in the horizon snapshot that is not the main path. For a horizon snapshot to contain sub-paths, the optionsHorizonOptions
for which it was generated must specify sub-path search optionsSubPathSearchOptions
for at least one sub-path level. - state: The horizon snapshot state
HorizonSnapshotState
mainPathID: The ID of the main path
HorizonPath
. Nil if there is no on-road map-matched position candidate. SeeHorizonPosition
for more details.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public struct HorizonSnapshot
- paths: List of horizon paths
-
Path in the horizon. The length of the path as well as which types of horizon elements
HorizonElement
it contains are determined by the set of horizon optionsHorizonOptions
for which horizon data was generated. For information on how to manage horizon options seeHorizonEngine
.registerHorizonOptions andHorizonEngine
.unregisterHorizonOptions.///For more information on horizon paths see
HorizonEngine
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonPath : Equatable
-
The best map-matched position on the horizon. It can be either on-road or off-road. If off-road, it can be either:
- The likeliest on-road position on the horizon, but flagged as off-road, if the likeliest position is off-road, but there are also on-road candidates. The user can extract horizon elements to facilitate the decision to join the road.
- Or an off-road position with an invalid path ID and an unmatched raw location, if the likeliest position is off-road and there are no on-road candidates on the horizon.
Horizon position can be extracted from the result
HorizonResult
of the callHorizonEngine
.generateHorizon
with a preregistered set ofHorizonOptions
used as an argument.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonPosition
-
State of the
HorizonSnapshot
that theHorizonEngine
generates based on a set of registeredHorizonOptions
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct HorizonSnapshotState : Equatable
-
Horizon path search distance configuration.
The search distance defines the extent of the path in the horizon.
For more information on horizon paths see
HorizonEngine
.For more information on horizon options see
HorizonOptions
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct PathSearchDistance : Equatable
-
Policy that binds the horizon path to the entire route.
The main path is the path the user currently follows, extending along the most likely trajectory. If the horizon options specify this policy, the horizon engine
HorizonEngine
searches along the entire route when extending the main path.For more information on horizon paths see
HorizonEngine
.For more information on horizon options see
HorizonOptions
.To search within a specific distance use the
ExplicitDistancePolicy
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct RouteLengthPolicy : PathSearchDistancePolicy