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.-
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 = 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 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 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 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 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 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 will be used.
routeWaypointsMarker
Optional route waypoints marker override. If it is not set the default marker will be 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 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?