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.

Lifecycle

  • Creates a RouteSection instance from the given parameters.

    Throws

    In case of an invalid range, throws RouteSection.Error.invalidRange.

    Declaration

    Swift

    public init(indexRange: ClosedRange<Int>, type: RouteSection.Type, textureURI: String? = nil) throws

    Parameters

    indexRange

    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.

    textureURI

    The URI of the route section texture. The protocol should be one of “asset” or “file”, default value is nil.

Public

  • 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.

    See more

    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.

    Declaration

    Swift

    public let indexRange: ClosedRange<Int>
  • Describes special road conditions for the route segment.

    Declaration

    Swift

    public let type: Type