RouteStyle

public struct RouteStyle

Represents a style configuration for the routes. The properties related to the active route (i.e. the properties prefixed with “active”) also apply to the selected route during the route planning phase. During instance construction, certain input values are checked against the range of values expected for that field (e.g., width values must be non-negative).

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Initializes route style.

    Throws

    RouteStyleError.invalidArgument If any of the following requirements are not met:

    Declaration

    Swift

    public init(
        activeLineColor: UIColor = Default.activeRouteLineColor,
        activeLineWidths: [Double: Double] = Default.lineZoomByWidthLevels,
        activeOutlineWidths: [Double: Double] = Default.outlineWidthsWithZoomLevels,
        alternativeLineColor: UIColor = Default.alternativeRouteLineColor,
        alternativeLineWidths: [Double: Double] = Default.lineZoomByWidthLevels,
        alternativeOutlineWidths: [Double: Double] = Default.outlineWidthsWithZoomLevels,
        alternativeLineColorOverrule: [Int: UIColor] = [:],
        routeDepartureMarker: UIImage? = nil,
        routeDestinationMarker: UIImage? = Default.destinationMarker,
        routeWaypointsMarker: UIImage? = Default.waypointMarker
    ) throws

    Parameters

    activeLineColor

    The UIColor of the active route. You can control the opacity of the route line by using the alpha component of the UIColor.

    activeLineWidths

    The line width of the active route. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level that width is used at.

    activeOutlineWidths

    The outline width of the active route. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    alternativeLineColor

    The UIColor of the alternative routes. This color may be overruled individually for each alternative route using alternativeLineColorOverrule. You can control the opacity of the route line by using the alpha component of the UIColor.

    alternativeLineWidths

    The outline width of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    alternativeOutlineWidths

    The outline width of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    alternativeLineColorOverrule

    The UIColor to individually overrule the color specified in alternativeLineColor. You can control the opacity of the route line by using the alpha component of the UIColor.

    routeDepartureMarker

    Optional route departure marker override. If it is not set, the default value is nil.

    routeDestinationMarker

    Optional route destination marker override. If it is not set the default marker will be used.

    routeWaypointsMarker

    Optional route waypoints marker override. If it is not set the default marker will be used.

Public

  • The UIColor of the active route. You can control the opacity of the route line by using the alpha component of the UIColor.

    Declaration

    Swift

    public let activeLineColor: UIColor
  • The UIColor of the alternative routes. This color may be overruled individually for each alternative route using alternativeLineColorOverrule. You can control the opacity of the route line by using the alpha component of the UIColor.

    Declaration

    Swift

    public let alternativeLineColor: UIColor
  • The UIColor to individually overrule the color specified in alternativeLineColor. You can control the opacity of the route line by using the alpha component of the UIColor.

    Declaration

    Swift

    public let alternativeLineColorOverrule: [Int : UIColor]
  • The line width of the active route. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level that width is used at.

    Declaration

    Swift

    public let activeLineWidths: [Double : Double]
  • The outline width of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    Declaration

    Swift

    public let alternativeLineWidths: [Double : Double]
  • The outline width of the active route. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    Declaration

    Swift

    public let activeOutlineWidths: [Double : Double]
  • The outline width of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the zoom and the width level that width is used at.

    Declaration

    Swift

    public let alternativeOutlineWidths: [Double : Double]
  • Optional route departure marker override.

    Declaration

    Swift

    public let routeDepartureMarker: UIImage?
  • Optional route destination marker override.

    Declaration

    Swift

    public let routeDestinationMarker: UIImage?
  • Route waypoints marker.

    Declaration

    Swift

    public let routeWaypointsMarker: UIImage?