BannerComponents

@Serializable
data class BannerComponents(val text: String, val type: BannerComponents.Type, val subType: BannerComponents.Type? = null, val abbreviation: String? = null, val abbreviationPriority: Int? = null, val imageBaseUrl: String? = null, val imageUrl: String? = null, val directions: List<String>? = null, val active: Boolean? = null)

A part of the BannerText which includes a snippet of the full banner text instruction. In cases where data is available, an image url will be provided to visually include a road shield. To receive this information, your request must have MapboxDirections.Builder#bannerInstructions() set to true.

Since

3.0.0

Constructors

Link copied to clipboard
constructor(text: String, type: BannerComponents.Type, subType: BannerComponents.Type? = null, abbreviation: String? = null, abbreviationPriority: Int? = null, imageBaseUrl: String? = null, imageUrl: String? = null, directions: List<String>? = null, active: Boolean? = null)

Types

Link copied to clipboard

Builder class for creating BannerComponents instances.

Link copied to clipboard

Properties

Link copied to clipboard
@SerialName(value = "abbr")
val abbreviation: String? = null

The abbreviated form of text.

Link copied to clipboard
@SerialName(value = "abbr_priority")
val abbreviationPriority: Int? = null

An integer indicating the order in which the abbreviation abbr should be used in place of text. The highest priority is 0 and a higher integer value indicates a lower priority. There are no gaps in integer values.

Link copied to clipboard
val active: Boolean? = null

A boolean telling you if that lane can be used to complete the upcoming maneuver. If multiple lanes are active, then they can all be used to complete the upcoming maneuver. Present if this is a lane component.

Link copied to clipboard
val directions: List<String>? = null

A List of directions indicating which way you can go from a lane (left, right, or straight). If the value is 'left', 'straight', the driver can go straight or left from that lane. Present if this is a lane component.

Link copied to clipboard
@SerialName(value = "imageBaseURL")
val imageBaseUrl: String? = null

In some cases when the LegStep is a highway or major roadway, there might be a shield icon that's included to better identify to your user to roadway. Note that this doesn't return the image itself but rather the url which can be used to download the file.

Link copied to clipboard
@SerialName(value = "imageURL")
val imageUrl: String? = null

In some cases when the StepManeuver will be difficult to navigate, an image can describe how to proceed. The domain name for this image is a Junction View. Unlike the imageBaseUrl, this image url does not include image density encodings.

Link copied to clipboard

String giving you more context about Type which may help in visual markup/display choices.

Link copied to clipboard

A snippet of the full BannerText.text which can be used for visually altering parts of the full string.

Link copied to clipboard

String giving you more context about the component which may help in visual markup/display choices. If the type of the components is unknown it should be treated as text.

Functions

Link copied to clipboard

Creates a builder initialized with the current values of the BannerComponents instance.