RouteTrafficIncidentStyle
public struct RouteTrafficIncidentStyle
Style configuration for on-route traffic incidents. 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).
Default assets such as fonts and icons are bundled into the framework.
You can provide custom icons in propertiesByMagnitudeOfDelay
Important
This is a Public Preview API. It may be changed or removed at any time.Whether traffic markers are visible. Default is true
.
Declaration
Swift
public let areMarkersVisible: Bool
Contains default styling properties for route traffic visualization.
See moreDeclaration
Swift
public enum Defaults
Initializes RouteTrafficIncidentStyle
with values from Defaults
.
Declaration
Swift
public init()
init(lineWidths:lineOutlineWidths:lineStartCapType:lineEndCapType:lineJointType:markerLabelFontURI:markerLabelTextSize:markerLabelTextOutlineWidth:markerLabelTextOffset:markerLabelTextAnchoring:markerVisibilityByCategory:propertiesByMagnitudeOfDelay:areMarkersVisible:)
Initializes RouteTrafficIncidentStyle
with the given values.
Throws
If any
is missing and not all other magnitudes of delay are provided, the initializer
will throw RouteStyleError
.
Declaration
Swift
public init(
lineWidths: [Double: Double] = Defaults.lineWidths,
lineOutlineWidths: [Double: Double] = Defaults.lineOutlineWidths,
lineStartCapType: LineCapType = Defaults.lineStartCapType,
lineEndCapType: LineCapType = Defaults.lineEndCapType,
lineJointType: LineJoinType = Defaults.lineJointType,
markerLabelFontURI: String = Defaults.Asset.markerLabelFontURI,
markerLabelTextSize: Double = Defaults.markerLabelTextSize,
markerLabelTextOutlineWidth: Double = Defaults.markerLabelTextOutlineWidth,
markerLabelTextOffset: MarkerLabelOptions.TextOffset = Defaults.markerLabelTextOffset,
markerLabelTextAnchoring: TextAnchoring = Defaults.markerLabelTextAnchoring,
markerVisibilityByCategory: [TrafficIncidentCategory: MarkerVisibility] = Defaults
.markerVisibilityByCategory,
propertiesByMagnitudeOfDelay: [MagnitudeOfDelayKey: MagnitudeOfDelayProperties] = Defaults.propertiesByMagnitudeOfDelay,
areMarkersVisible: Bool = Defaults.areMarkersVisible
) throws
Parameters
lineWidths
|
The line width of the on-route traffic lines. By default, |
lineOutlineWidths
|
The outline width of the on-route traffic lines. By default, |
lineStartCapType
|
The on-route traffic line start cap. By default, |
lineEndCapType
|
The on-route traffic line end cap. By default, |
lineJointType
|
The on-route traffic line joint type. By default, |
markerLabelFontURI
|
The URL of the font for the label text in the traffic marker. By default, |
markerLabelTextSize
|
The size of the label text in the traffic marker. By default, |
markerLabelTextOutlineWidth
|
The width of the outline of the label text in the traffic marker. By default, |
markerLabelTextOffset
|
The offset that will be used to position the label in the traffic marker. By default, |
markerLabelTextAnchoring
|
The anchoring that determines how the label is positioned on the traffic marker. By default, |
markerVisibilityByCategory
|
The visibility of traffic incident markers by category. By default, |
Important
|
Control of traffic incident marker visibility is not implemented yet. |
propertiesByMagnitudeOfDelay
|
Style properties for traffic incidents by magnitude of delay. By default, |
areMarkersVisible
|
Whether traffic markers are visible. By default, |
The on-route traffic line end cap.
Declaration
Swift
public let lineEndCapType: LineCapType
The on-route traffic line joint type.
Declaration
Swift
public let lineJointType: LineJoinType
The outline line width of on-route traffic lines. This parameter must be a non-empty dictionary containing non-negative values for both the width and the zoom level where that width is used.
Declaration
Swift
public let lineOutlineWidths: [Double : Double]
The on-route traffic line start cap.
Declaration
Swift
public let lineStartCapType: LineCapType
The line widths of on-route traffic lines. This parameter must be a non-empty dictionary containing non-negative values for both the width and the zoom level where that width is used.
Declaration
Swift
public let lineWidths: [Double : Double]
Key for the magnitude of delay of traffic incidents used in RouteTrafficIncidentStyle
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum MagnitudeOfDelayKey
The traffic incident style properties that have specific values per magnitude of delay.
Traffic incidents may have different magnitudes of delay associated with them: unknown, minor, moderate, major, or indefinite.
PropertiesByMagnitudeOfDelay
stores traffic incident style properties whose specific values depend on the magnitude of delay.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct MagnitudeOfDelayProperties
The URI of the font for the label text in the traffic marker.
Declaration
Swift
public let markerLabelFontURI: String
The anchoring that determines how the label is positioned on the traffic marker.
Declaration
Swift
public let markerLabelTextAnchoring: TextAnchoring
The offset that will be used to position the label in the traffic marker.
Declaration
Swift
public let markerLabelTextOffset: MarkerLabelOptions.TextOffset
The width of the outline of the label text in the traffic marker.
Declaration
Swift
public let markerLabelTextOutlineWidth: Double
The size of the label text in the traffic marker.
Declaration
Swift
public let markerLabelTextSize: Double
Describes marker visibility setup by zoom level and camera tilt.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct MarkerVisibility
Traffic incident marker visibility by category. That dictionary does not have to contain keys of all possible categories. If a category is missing in the dictionary, markers of that category will not be displayed.
Declaration
Swift
public let markerVisibilityByCategory: [TrafficIncidentCategory : MarkerVisibility]
Style properties for traffic incidents by magnitude of delay.
This dictionary may not contain keys for all possible magnitudes of delay.
If a magnitude of delay is missing in the dictionary, style for MagnitudeOfDelayKey.any
is used.
Declaration
Swift
public let propertiesByMagnitudeOfDelay: [MagnitudeOfDelayKey : MagnitudeOfDelayProperties]
Key for categories of on-route traffic incidents used in RouteTrafficIncidentStyle
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum TrafficIncidentCategoryKey