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: ) Initializes route style.
Throws
RouteStyleError.invalidArgument
If any of the following requirements are not met:activeLineWidths
,alternativeLineWidths
,activeOutlineWidths
andalternativeOutlineWidths
should contain positiveDouble
.activeOutlineWidths
should be equal to 1.activeLineWidths
should be equal toalternativeLineWidths
.activeOutlineWidths
should 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 ) throws
Parameters
activeLineColor
The
UIColor
of the active route. You can control the opacity of the route line by using the alpha component of theUIColor
.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 positive values for both the zoom and the width level used.
alternativeLineColor
The
UIColor
of 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
.alternativeLineWidths
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.
alternativeOutlineWidths
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.
alternativeLineColorOverrule
The
UIColor
to individually overrule the color specified inalternativeLineColor
. You can control the opacity of the route line by using the alpha component of theUIColor
.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 is used.
routeWaypointsMarker
Optional route waypoints marker override. If it is not set, the default marker is used.
-
The
UIColor
of 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
UIColor
of 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
UIColor
to 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?