RouteTrafficIncidentStyle
public struct RouteTrafficIncidentStyle
Style configuration for on-route traffic. 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 only need to provide files for assets that you want to customize. To customize marker and icon images, replace the default image files in your application’s bundle(Bundle.main) with new versions. The custom image files must have the same name as the default image files provided within the library. See the table below.
Magnitude of Delay | Asset | File Path |
---|---|---|
MagnitudeOfDelay.unknown |
Marker base icon all categories except road works | marker_traffic_bg_base |
MagnitudeOfDelay.unknown |
Marker base icon for the road works category | marker_traffic_roadworks_bg_base |
MagnitudeOfDelay.unknown |
Marker icon for the road works category | ic_map_roadworks |
MagnitudeOfDelay.unknown |
Marker icon for the unknown category | ic_map_info |
MagnitudeOfDelay.minor |
Marker base icon | marker_traffic_minor_bg_base |
MagnitudeOfDelay.minor |
Marker icon for the road works category | ic_map_minor_roadworks |
MagnitudeOfDelay.minor |
Marker icon for the unknown category | ic_map_minor_info |
MagnitudeOfDelay.moderate |
Marker base icon | marker_traffic_moderate_bg_base |
MagnitudeOfDelay.moderate |
Marker icon for the road works category | ic_map_moderate_roadworks |
MagnitudeOfDelay.moderate |
Marker icon for the unknown category | ic_map_moderate_info |
MagnitudeOfDelay.major |
Marker base icon | marker_traffic_major_bg_base |
MagnitudeOfDelay.major |
Marker icon for the road works category | ic_map_major_roadworks |
MagnitudeOfDelay.major |
Marker icon for the unknown category | ic_map_major_info |
MagnitudeOfDelay.indefinite |
Marker base icon | marker_traffic_road_closed_bg_base |
MagnitudeOfDelay.indefinite |
Marker icon for the road closed category | ic_map_road_closed |
Since vector images are not supported, it is recommended to add every size of the image to the bundle.
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(lineWidths:
outlineWidths: lineStartCapType: lineEndCapType: lineJointType: markerLabelFontURL: markerLabelTextSize: markerLabelOutlineWidth: markerLabelTextOffset: markerLabelTextAnchoring: markerVisibilityByCategory: magnitudeOfDelayUnknownStyle: magnitudeOfDelayMinorStyle: magnitudeOfDelayModerateStyle: magnitudeOfDelayMajorStyle: magnitudeOfDelayIndefiniteStyle: ) Initializes the style configuration for on-route traffic.
Declaration
Swift
public init( lineWidths: [Double: Double] = Default.lineWidths, outlineWidths: [Double: Double] = Default.outlineWidths, lineStartCapType: LineCapType = Default.lineStartCapType, lineEndCapType: LineCapType = Default.lineEndCapType, lineJointType: LineJoinType = Default.lineJointType, markerLabelFontURL: String = Default.Asset.markerLabelFontURI, markerLabelTextSize: Double = Default.markerLabelTextSize, markerLabelOutlineWidth: Double = Default.markerLabelOutlineWidth, markerLabelTextOffset: MarkerLabelOptions.TextOffset = Default.markerLabelTextOffset, markerLabelTextAnchoring: TextAnchoring = Default.markerLabelTextAnchoring, markerVisibilityByCategory: [TrafficIncidentCategory: MarkerVisibility] = Default .markerVisibilityByCategory, magnitudeOfDelayUnknownStyle: MagnitudeOfDelayStyle = Default.magnitudeOfDelayUnknownStyle, magnitudeOfDelayMinorStyle: MagnitudeOfDelayStyle = Default.magnitudeOfDelayMinorStyle, magnitudeOfDelayModerateStyle: MagnitudeOfDelayStyle = Default.magnitudeOfDelayModerateStyle, magnitudeOfDelayMajorStyle: MagnitudeOfDelayStyle = Default.magnitudeOfDelayMajorStyle, magnitudeOfDelayIndefiniteStyle: MagnitudeOfDelayStyle = Default.magnitudeOfDelayIndefiniteStyle ) throws
Parameters
lineWidths
The line width of the 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 to be used.
outlineWidths
The outline width of the 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 to be used.
lineStartCapType
The on-route traffic line start cap.
lineEndCapType
The on-route traffic line end cap.
lineJointType
The on-route traffic line joint type.
markerLabelFontURL
The URL of the font for the label text in the traffic marker.
markerLabelTextSize
The size of the label text in the traffic marker.
markerLabelOutlineWidth
The width of the outline of the label text in the traffic marker.
markerLabelTextOffset
The offset that will be used to position the label in the traffic marker.
markerLabelTextAnchoring
The anchoring that determines how the label is positioned on the traffic marker.
markerVisibilityByCategory
The visibility of traffic incident markers by category. This 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.
Important
Control of traffic incident marker visibility is not implemented yet.
magnitudeOfDelayUnknownStyle
Style properties for traffic incidents with
MagnitudeOfDelay.unknown
.magnitudeOfDelayMinorStyle
Style properties for traffic incidents with
MagnitudeOfDelay.minor
.magnitudeOfDelayModerateStyle
Style properties for traffic incidents with
MagnitudeOfDelay.moderate
.magnitudeOfDelayMajorStyle
Style properties for traffic incidents with
MagnitudeOfDelay.major
.magnitudeOfDelayIndefiniteStyle
Style properties for traffic incidents with
MagnitudeOfDelay.indefinite
.
-
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]
-
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 outlineWidths: [Double : Double]
-
The on-route traffic line start cap.
Declaration
Swift
public let lineStartCapType: LineCapType
-
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 URL of the font for the label text in the traffic marker.
Declaration
Swift
public let markerLabelFontURL: String
-
The size of the label text in the traffic marker.
Declaration
Swift
public let markerLabelTextSize: Double
-
The width of the outline of the label text in the traffic marker.
Declaration
Swift
public let markerLabelOutlineWidth: Double
-
The offset that will be used to position the label in the traffic marker.
Declaration
Swift
public let markerLabelTextOffset: MarkerLabelOptions.TextOffset
-
The anchoring that determines how the label is positioned on the traffic marker.
Declaration
Swift
public let markerLabelTextAnchoring: TextAnchoring
-
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 with
MagnitudeOfDelay.unknown
.Declaration
Swift
public let magnitudeOfDelayUnknownStyle: MagnitudeOfDelayStyle
-
Style properties for traffic incidents with
MagnitudeOfDelay.minor
.Declaration
Swift
public let magnitudeOfDelayMinorStyle: MagnitudeOfDelayStyle
-
Style properties for traffic incidents with
MagnitudeOfDelay.moderate
.Declaration
Swift
public let magnitudeOfDelayModerateStyle: MagnitudeOfDelayStyle
-
Style properties for traffic incidents with
MagnitudeOfDelay.major
.Declaration
Swift
public let magnitudeOfDelayMajorStyle: MagnitudeOfDelayStyle
-
Style properties for traffic incidents with
MagnitudeOfDelay.undefinite
.Declaration
Swift
public let magnitudeOfDelayIndefiniteStyle: MagnitudeOfDelayStyle