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.

Lifecycle

Public

  • 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