RouteSection
public struct RouteSection
A model that represents a part of the road under some special conditions, i.e., a tunnel or a non-drivable road, with a respective range.
This model describes these road segments, and then passes these segments to RouteOptions
as part of the route’s configuration that is drawn on the map.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates a
RouteSection
instance from the given parameters.Throws
In case of an invalid range, throwsRouteSectionError.invalidRange
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init(range: ClosedRange<Int>, type: RouteSection.Type) throws
Parameters
range
The range of the route section represents indices in the
RouteOptions
‘ array of coordinates, therefore a valid range’s lower bound must be equal to or greater than 0 and the range length must be greater than 1.type
Describes special road conditions for the route segment.
-
Describes special road conditions for the route segment. Each type has its respective range, and within that range, the road is under special road conditions, i.e., a tunnel, or a non-drivable type, which is later used as configuration for the route that is drawn on the map, and is drawn differently than the rest of the route.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum RouteSection.`Type`
-
The range of the route section represents indices in the route’s coordinates array, therefore a valid range’s lower bound must be equal to or greater than 0 and the range length must be greater than 1.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public let range: ClosedRange<Int>
-
Describes special road conditions for the route segment.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public let type: Type