RouteOptions

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 isFollowable: Boolean = false, val routeOffset: List<Distance> = emptyList(), val sections: List<RouteSection> = emptyList(), val departureMarkerPinImage: Image? = DEFAULT_DEPARTURE_ICON, val destinationMarkerPinImage: Image? = DEFAULT_DESTINATION_ICON, val departure: GeoPoint? = null, val destination: GeoPoint? = null)

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

Constructors

Link copied to clipboard
constructor(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, isFollowable: Boolean = false, routeOffset: List<Distance> = emptyList(), sections: List<RouteSection> = emptyList(), departureMarkerPinImage: Image? = DEFAULT_DEPARTURE_ICON, destinationMarkerPinImage: Image? = DEFAULT_DESTINATION_ICON, departure: GeoPoint? = null, destination: GeoPoint? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Determines the visibility of the instructions on route. By default, it's set to true.

Link copied to clipboard
val color: Int

Color of the route tube. Colors for the style of the route tube (route, dotted line and outline colors) will be selected based on this color.

Link copied to clipboard
val departure: GeoPoint? = null

This specifies where the departureMarkerPinImage is located. If you pass null, departure marker will be shown on the first point of the geometry.

Link copied to clipboard

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

Link copied to clipboard

Determines the visibility of the departure marker.

Link copied to clipboard
val destination: GeoPoint? = null

This specifies where the destinationMarkerPinImage is located. If you pass null, the departure marker is shown on the last point of the geometry.

Link copied to clipboard

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

Link copied to clipboard

Determines the visibility of the destination marker.

Link copied to clipboard

Geometry of the Route.

Link copied to clipboard

List of Instruction for maneuvers along the Route.

Link copied to clipboard
val isFollowable: Boolean = false

Determines whether this Route is followable or not.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

a list of Distance instances that represent the offset along the route for each point in the route's geometry. These offsets help in positioning instruction arrows and determining route progress. The n-th element in routeOffset represents the distance from the start of the route to the n-th point in the geometry. If not explicitly set, routeOffset is derived from the distances between geometry points during the construction of RouteOptions.

Link copied to clipboard

Information about sections on the route.

Link copied to clipboard
val tag: String? = null

Optional holder for custom extra information about the requested Route.

Link copied to clipboard
val visible: Boolean = true

Determines the visibility of the Route.

Link copied to clipboard

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.

Functions

Link copied to clipboard
fun copy(geometry: List<GeoPoint> = this.geometry, @ColorInt color: Int = this.color, @FloatRange(from = 0.0) outlineWidth: Double = this.outlineWidth, widths: List<WidthByZoom> = this.widths, visible: Boolean = this.visible, progress: Distance = this.progress, instructions: List<Instruction> = this.instructions, tag: String? = this.tag, departureMarkerVisible: Boolean = this.departureMarkerVisible, destinationMarkerVisible: Boolean = this.destinationMarkerVisible, isFollowable: Boolean = this.isFollowable, routeOffset: List<Distance> = this.routeOffset, sections: List<RouteSection> = this.sections, departureMarkerPinImage: Image? = this.departureMarkerPinImage, destinationMarkerPinImage: Image? = this.destinationMarkerPinImage, departureMarkerCoordinate: GeoPoint? = this.departure, destinationMarkerCoordinate: GeoPoint? = this.destination): RouteOptions
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String