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). Default assets and resources are bundled into the library. You do not need to supply any asset/resource files unless you want to customize something (for example, the icon of waypoint markers).
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(activeLineColor:
activeLineWidths: activeOutlineWidths: alternativeLineColor: alternativeLineWidths: alternativeOutlineWidths: alternativeLineColorOverrule: departureMarkerImage: destinationMarkerImage: waypointsMarkerImage: areWaypointsVisible: ) Initializes route style.
Throws
RouteStyleError/invalidArgument
if any of the following requirements are not met:activeLineWidths
,alternativeLineWidths
,activeOutlineWidths
andalternativeOutlineWidths
should contain positive Double.activeOutlineWidths
should be equal to 1.activeLineWidths
should be equal toalternativeLineWidths
.activeOutlineWidths
should be equal toalternativeOutlineWidths
.
Declaration
Swift
public init( activeLineColor: UIColor = Defaults.activeLineColor, activeLineWidths: [Double: Double] = Defaults.activeLineWidths, activeOutlineWidths: [Double: Double] = Defaults.activeOutlineWidths, alternativeLineColor: UIColor = Defaults.alternativeLineColor, alternativeLineWidths: [Double: Double] = Defaults.alternativeLineWidths, alternativeOutlineWidths: [Double: Double] = Defaults.alternativeOutlineWidths, alternativeLineColorOverrule: [Int: UIColor] = [:], departureMarkerImage: UIImage? = nil, destinationMarkerImage: UIImage? = Defaults.destinationMarkerImage, waypointsMarkerImage: UIImage? = Defaults.waypointsMarkerImage, areWaypointsVisible: Bool = Defaults.areWaypointsVisible ) throws
-
The color 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 line width (in point unit) of the active route. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level at which the width is used.
Declaration
Swift
public let activeLineWidths: [Double : Double]
-
The outline width (in point unit) of the active route.
Warning
The current implementation requires the size of this list to be 1. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level at which the width is used.Declaration
Swift
public let activeOutlineWidths: [Double : Double]
-
The color 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 theUIColor
.Declaration
Swift
public let alternativeLineColor: UIColor
-
The outline width (in point unit) of the alternative routes. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level at which the width is used.
Warning
The current implementation requires this list to be equal toactiveLineWidths
.Declaration
Swift
public let alternativeLineWidths: [Double : Double]
-
The outline width (in point unit) of the alternative routes. This parameter must be a non-empty array containing non-negative values for both the zoom and the width level at which the width is used.
Warning
The current implementation requires this list to be equal toactiveOutlineWidths
.Declaration
Swift
public let alternativeOutlineWidths: [Double : Double]
-
alternativeLineColor
sets the same color for all the alternative routes. If it’s desired to overrule this semantic, this property can be used by specifying the color per the index of the alternative route.Declaration
Swift
public let alternativeLineColorOverrule: [Int : UIColor]
-
The image for the departure marker. By default, the departure marker is hidden.
Declaration
Swift
public let departureMarkerImage: UIImage?
-
The image for the destination marker. By default, the default marker is used.
Declaration
Swift
public let destinationMarkerImage: UIImage?
-
The image for the waypoint markers.
Declaration
Swift
public let waypointsMarkerImage: UIImage?
-
A boolean flag for enabling or disabling the visualization of waypoint markers. By default, the waypoints are visible.
Declaration
Swift
public let areWaypointsVisible: Bool