Route
public class Route
extension Route: NativeBase
extension Route: Hashable
A route is a path through a road network over which someone travels.
Note: Each Section of a route contains a list of SectionNotice objects
that describe potential issues after the route was calculated. If the list is non-empty,
it is recommended to evaluate possible violations against the requested route options and
reject the route if deemed necessary.
-
The sections that make up this route.
Declaration
Swift
public private(set) lazy var sections: [Section] { get set } -
The
GeoPolylineobject representing the polyline of this route. It may not contain the original coordinates specified in the request for a route.Declaration
Swift
public private(set) lazy var geometry: GeoPolyline { get set } -
The closest rectangular area where this route fits in.
Declaration
Swift
public var boundingBox: GeoBox { get } -
The length of this route in meters.
Declaration
Swift
public var lengthInMeters: Int32 { get } -
Indicates the language requested for all textual information related to this route.
Declaration
Swift
public var language: LanguageCode { get } -
The optimization mode requested for route calculation.
Declaration
Swift
public var optimizationMode: OptimizationMode { get } -
The transport mode requested for route calculation.
Declaration
Swift
public var requestedTransportMode: TransportMode { get } -
Estimated net energy consumption (in kWh) if the transportation mode used for this route is an electric vehicle. Note that it can be negative due to energy recuperation.
Declaration
Swift
public var consumptionInKilowattHours: Double? { get } -
The route handle of this route. Note that it is provided only if
RouteOptions.enableRouteHandleis set before route calculation.Declaration
Swift
public var routeHandle: RouteHandle? { get } -
The estimated time in seconds needed to travel along this route, including real-time traffic delays if available.
Declaration
Swift
public var duration: TimeInterval { get } -
The estimated time in seconds spent in traffic along this route. Negative values indicate that the route can be traversed faster than usual.
Declaration
Swift
public var trafficDelay: TimeInterval { get } -
The set of options used to calculate the route.
Declaration
Swift
public var routingOptions: RoutingOptions? { get } -
Collection of railway crossings along the route. Railway crossing information is only available for routes created with the online
RoutingEngine.Declaration
Swift
public private(set) lazy var railwayCrossings: [RouteRailwayCrossing] { get set } -
A collection containing a maximum of 2
RouteLabelinstances for the route. It will return an empty list if no labels are available. The main street names or route numbers through which the route is going to pass that differentiate it from other alternatives routes. The labels are ordered by importance based on how much time the route spends on each road segment, not by traversal sequence. This helps users quickly identify and distinguish between different route alternatives when alternative routes have been quested viaRouteOptions.Declaration
Swift
public private(set) lazy var routeLabels: [RouteLabel] { get set } -
Serializes given route to a binary data. Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public static func serialize(_ route: Route) -> Data?Parameters
routeThe route which should be serialized.
Return Value
The binary data of the route.
-
Creates route from the given binary data. Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public static func deserialize(_ routeData: Data) -> Route?Parameters
routeDataThe binary of a serialized route.
Return Value
The route object restored from the binary data.