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 positive).
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(activeLineColor:activeLineWidths: activeOutlineWidths: alternativeLineColor: alternativeLineWidths: alternativeOutlineWidths: alternativeLineColorOverrule: routeDepartureMarker: routeDestinationMarker: routeWaypointsMarker: waypointsVisible: ) Initializes route style.
Throws
RouteStyleError.invalidArgumentIf any of the following requirements are not met:activeLineWidths,alternativeLineWidths,activeOutlineWidthsandalternativeOutlineWidthsshould contain positiveDouble.activeOutlineWidthsshould be equal to 1.activeLineWidthsshould be equal toalternativeLineWidths.activeOutlineWidthsshould be equal toalternativeOutlineWidths.
Declaration
Swift
public init( activeLineColor: UIColor = Defaults.activeRouteLineColor, activeLineWidths: [Double: Double] = Defaults.lineZoomByWidthLevels, activeOutlineWidths: [Double: Double] = Defaults.outlineWidthsWithZoomLevels, alternativeLineColor: UIColor = Defaults.alternativeRouteLineColor, alternativeLineWidths: [Double: Double] = Defaults.lineZoomByWidthLevels, alternativeOutlineWidths: [Double: Double] = Defaults.outlineWidthsWithZoomLevels, alternativeLineColorOverrule: [Int: UIColor] = [:], routeDepartureMarker: UIImage? = nil, routeDestinationMarker: UIImage? = Defaults.destinationMarker, routeWaypointsMarker: UIImage? = Defaults.waypointMarker, waypointsVisible: Bool = Defaults.waypointsVisible ) throwsParameters
activeLineColorThe
UIColorof the active route. You can control the opacity of the route line by using the alpha component of theUIColor.activeLineWidthsThe 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.
activeOutlineWidthsThe outline width of the active route. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
alternativeLineColorThe
UIColorof the alternative routes. This color may be overruled individually for each alternative route usingalternativeLineColorOverrule. You can control the opacity of the route line by using the alpha component of theUIColor.alternativeLineWidthsThe outline width of the alternative routes. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
alternativeOutlineWidthsThe outline width of the alternative routes. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
alternativeLineColorOverruleThe
UIColorto individually overrule the color specified inalternativeLineColor. You can control the opacity of the route line by using the alpha component of theUIColor.routeDepartureMarkerOptional route departure marker override. If it is not set, the default value is nil.
routeDestinationMarkerOptional route destination marker override. If it is not set, the default marker is used.
routeWaypointsMarkerOptional route waypoints marker override. If it is not set, the default marker is used.
waypointsVisibleA boolean flag for enabling or disabling the visualistaion of waypoints. If it is not set, by default the waypoints are visible.
-
The
UIColorof the active route. You can control the opacity of the route line by using the alpha component of theUIColor.Declaration
Swift
public let activeLineColor: UIColor -
The
UIColorof the alternative routes. This color may be overruled individually for each alternative route usingalternativeLineColorOverrule. You can control the opacity of the route line by using the alpha component of theUIColor.Declaration
Swift
public let alternativeLineColor: UIColor -
The
UIColorto individually overrule the color specified inalternativeLineColor. You can control the opacity of the route line by using the alpha component of theUIColor.Declaration
Swift
public let alternativeLineColorOverrule: [Int : UIColor] -
The line width of the active route. This parameter must be a non-empty array containing positive values for both the zoom and the width level used.
Declaration
Swift
public let activeLineWidths: [Double : Double] -
The outline width of the alternative routes. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
Declaration
Swift
public let alternativeLineWidths: [Double : Double] -
The outline width of the active route. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
Declaration
Swift
public let activeOutlineWidths: [Double : Double] -
The outline width of the alternative routes. This parameter must be a non-empty list containing positive values for both the zoom and the width level used.
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? -
Toggle the visibility of waypoints. If set to true then markers are visible, if set to false markers are hidden.
Declaration
Swift
public let waypointsVisible: Bool
RouteStyle Structure Reference