RouteStyle

data class RouteStyle(val activeLineColor: Color = DEFAULT_ACTIVE_LINE_COLOR, val alternativeLineColor: Color = DEFAULT_ALTERNATIVE_LINE_COLOR, val alternativeLineColorOverrule: Map<Int, Color> = emptyMap(), val activeLineWidths: List<WidthByZoom> = DEFAULT_ACTIVE_LINE_WIDTHS, val alternativeLineWidths: List<WidthByZoom> = DEFAULT_ALTERNATIVE_LINE_WIDTHS, val activeOutlineWidths: List<WidthByZoom> = DEFAULT_ACTIVE_OUTLINE_WIDTHS, val alternativeOutlineWidths: List<WidthByZoom> = DEFAULT_ALTERNATIVE_OUTLINE_WIDTHS)

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 non-negative).

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). To customize marker pin and icon images, replace the default image files in your application's res or assets folder with new, custom versions. The custom image files must have the same file path as the default image files provided within the library. See the following table:

Asset/Resource File Path
Pin of the destination marker <app_assets>/icons@/route-markers/ic_map_poi_pin_base.png
Pin of the waypoint markers <app_res>/drawable@/map_marker_generic_bg_base.png
Icon of the waypoint markers <app_res>/drawable@/marker_ic_generic.png

In the table above @ is a placeholder for the density dpi suffix, meaning either: -ldpi, -mdpi, -hdpi, -xhdpi, -xxhdpi, or -xxxhdpi.

Important: This is a Public Preview API. It may be changed or removed at any time.

Parameters

activeLineColor

The Color of the active route. You can control the opacity of the route line by using the alpha component of the Color.

alternativeLineColor

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 the Color.

alternativeLineColorOverrule

The colors to individually overrule the color specified in alternativeLineColor. You can control the opacity of the route line by using the alpha component of the Color.

activeLineWidths

The line width (in dp units) of the active route. This parameter must be a non-empty list containing non-negative values for both the width and the zoom level that width is used at. Items in this list must not contain duplicated zoom level values.

alternativeLineWidths

The outline width (in dp units) of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the width and the zoom level that width is used at. Items in this list must not contain duplicated zoom level values.

WARNING: THE CURRENT IMPLEMENTATION REQUIRES THIS LIST TO BE EQUAL TO activeLineWidths.

activeOutlineWidths

The outline width (in dp units) of the active route. This parameter must be a non-empty list containing non-negative values for both the width and the zoom level that width is used at. Items in this list must not contain duplicated zoom level values.

WARNING: THE CURRENT IMPLEMENTATION REQUIRES THE SIZE OF THIS LIST TO BE 1.

alternativeOutlineWidths

The outline width (in dp units) of the alternative routes. This parameter must be a non-empty list containing non-negative values for both the width and the zoom level that width is used at. Items in this list must not contain duplicated zoom level values.

WARNING: THE CURRENT IMPLEMENTATION REQUIRES THIS LIST TO BE EQUAL TO activeOutlineWidths.

Constructors

Link copied to clipboard
fun RouteStyle(activeLineColor: Color = DEFAULT_ACTIVE_LINE_COLOR, alternativeLineColor: Color = DEFAULT_ALTERNATIVE_LINE_COLOR, alternativeLineColorOverrule: Map<Int, Color> = emptyMap(), activeLineWidths: List<WidthByZoom> = DEFAULT_ACTIVE_LINE_WIDTHS, alternativeLineWidths: List<WidthByZoom> = DEFAULT_ALTERNATIVE_LINE_WIDTHS, activeOutlineWidths: List<WidthByZoom> = DEFAULT_ACTIVE_OUTLINE_WIDTHS, alternativeOutlineWidths: List<WidthByZoom> = DEFAULT_ALTERNATIVE_OUTLINE_WIDTHS)

Types

Link copied to clipboard
object Companion

Properties