RoadClasses
public struct RoadClasses : OptionSet, CustomStringConvertible
extension RoadClasses: Codable
Option set that contains attributes of a road segment.
-
Declaration
Swift
public var rawValue: Int
-
Declaration
Swift
public init(rawValue: Int)
-
The road segment is tolled.
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let toll: RoadClasses
-
The road segment has access restrictions.
A road segment may have this class if there are general access restrictions or a high-occupancy vehicle restriction.
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let restricted: RoadClasses
-
The road segment is a freeway or freeway ramp.
It may be desirable to suppress the name of the freeway when giving instructions and give instructions at fixed distances before an exit (such as 1 mile or 1 kilometer ahead).
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let motorway: RoadClasses
-
The user must travel this segment of the route by ferry.
The user should verify that the ferry is in operation. For driving and cycling directions, the user should also verify that their vehicle is permitted onboard the ferry.
In general, the transport type of the step containing the road segment is also
TransportType.ferry
.This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let ferry: RoadClasses
-
The user must travel this segment of the route through a tunnel.
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let tunnel: RoadClasses
-
The road segment is a high occupancy vehicle road that requires a minimum of two vehicle occupants.
This option includes high occupancy vehicle road segments that require a minimum of two vehicle occupants only, not high occupancy vehicle lanes.
If the user is in a high-occupancy vehicle with two occupants and would accept a route that uses a high occupancy toll road, specify both
highOccupancyVehicle2
andhighOccupancyToll
. Otherwise, the routes will avoid any road that requires anyone to pay a toll.This option can only be used with
RouteOptions.roadClassesToAllow
.Declaration
Swift
public static let highOccupancyVehicle2: RoadClasses
-
The road segment is a high occupancy vehicle road that requires a minimum of three vehicle occupants.
This option includes high occupancy vehicle road segments that require a minimum of three vehicle occupants only, not high occupancy vehicle lanes.
This option can only be used with
RouteOptions.roadClassesToAllow
.Declaration
Swift
public static let highOccupancyVehicle3: RoadClasses
-
The road segment is a high occupancy toll road that is tolled if the user’s vehicle does not meet the minimum occupant requirement.
This option includes high occupancy toll road segments only, not high occupancy toll lanes.
This option can only be used with
RouteOptions.roadClassesToAllow
.Declaration
Swift
public static let highOccupancyToll: RoadClasses
-
The user must travel this segment of the route on an unpaved road.
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let unpaved: RoadClasses
-
The road segment is tolled and only accepts cash payment.
This option can only be used with
RouteOptions.roadClassesToAvoid
.Declaration
Swift
public static let cashTollOnly: RoadClasses
-
Creates a
RoadClasses
given an array of strings.Declaration
Swift
public init?(descriptions: [String])
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public init(from decoder: Decoder) throws