RouteOptions

data class RouteOptions(val geometry: List<GeoPoint>, @ColorInt val color: Int = DEFAULT_COLOR, @FloatRange(from = 0.0) val outlineWidth: Double = DEFAULT_OUTLINE_WIDTH, val widths: List<WidthByZoom> = DEFAULT_WIDTHS, val visible: Boolean = true, val progress: Distance = Distance.ZERO, val instructions: List<Instruction> = emptyList(), val tag: String? = null, val departureMarkerVisible: Boolean = false, val destinationMarkerVisible: Boolean = false, val followable: Boolean = false, val routeOffset: List<Distance> = emptyList(), val sections: List<RouteSection> = emptyList(), val departureMarkerPinImage: Image? = null, val destinationMarkerPinImage: Image? = null)

Configures options for a Route representation which can be added and displayed on the map. See TomTomMap.addRoute(routeOptions: RouteOptions).

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

Parameters

geometry

Geometry of the Route.

color

Color of the route tube.

outlineWidth

Width of the route outline in density-independent pixels (dp).

widths

Widths of the route tube for different zoom levels. If the same width should be applied for all zoom levels, then the zoom value can be skipped in the WidthByZoom initialization.

visible

Determines the visibility of the Route.

progress

Sets the route progress. The internal map mechanism automatically renders the driven route section in a slightly different color which brings a pleasant user experience.

instructions

List of Instruction for maneuvers along the Route.

tag

Optional holder for custom extra information about the requested Route.

departureMarkerVisible

Determines the visibility of the departure marker.

destinationMarkerVisible

Determines the visibility of the destination marker.

followable

Determines whether this Route is followable or not.

A followable route is eligible to be followed by CameraTrackingMode.FOLLOW_ROUTE. Only one Route can be followed at a time. When newly added route is marked as followable, the previous one stops being followable.

routeOffset

List of Distance for route progress values along the Route.

sections

Information about sections on the route.

All start's and end's should exist in the route geometry.

departureMarkerPinImage

Image that will be used as the departure marker pin. If you pass null, the default image is used.

destinationMarkerPinImage

Image that will be used as the destination marker pin. If you pass null, the default image is used.

Constructors

Link copied to clipboard
fun RouteOptions(geometry: List<GeoPoint>, @ColorInt color: Int = DEFAULT_COLOR, @FloatRange(from = 0.0) outlineWidth: Double = DEFAULT_OUTLINE_WIDTH, widths: List<WidthByZoom> = DEFAULT_WIDTHS, visible: Boolean = true, progress: Distance = Distance.ZERO, instructions: List<Instruction> = emptyList(), tag: String? = null, departureMarkerVisible: Boolean = false, destinationMarkerVisible: Boolean = false, followable: Boolean = false, routeOffset: List<Distance> = emptyList(), sections: List<RouteSection> = emptyList(), departureMarkerPinImage: Image? = null, destinationMarkerPinImage: Image? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val color: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val followable: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tag: String? = null
Link copied to clipboard
val visible: Boolean = true
Link copied to clipboard