ReplayRouteMapper

class ReplayRouteMapper @JvmOverloads constructor(var options: ReplayRouteOptions = ReplayRouteOptions.Builder().build())

This class converts a DirectionsRoute into events that can be replayed using the MapboxReplayer to navigate a route.

Constructors

Link copied to clipboard
fun ReplayRouteMapper(options: ReplayRouteOptions = ReplayRouteOptions.Builder().build(), logger: Logger)
Link copied to clipboard
fun ReplayRouteMapper(options: ReplayRouteOptions = ReplayRouteOptions.Builder().build())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun mapDirectionsRouteGeometry(directionsRoute: DirectionsRoute): List<ReplayEventBase>

Take a DirectionsRoute and map it to events that can be replayed by the MapboxReplayer. Uses the Directions API DirectionsRoute.geometry to calculate the speed and position estimates for the replay locations.

Link copied to clipboard
fun mapDirectionsRouteLegAnnotation(directionsRoute: DirectionsRoute): List<ReplayEventBase>

Take a DirectionsRoute and map it to events that can be replayed by the MapboxReplayer. Uses the Directions API LegAnnotation to create the speed and position estimates for the replay locations.

Link copied to clipboard
fun mapGeometry(geometry: String): List<ReplayEventBase>

Simulate a driver navigating a polyline string.

Link copied to clipboard
fun mapPointList(points: List<Point>): List<ReplayEventBase>

Take a list of Point and map it to events that can be replayed by the MapboxReplayer.

Link copied to clipboard
fun mapRouteLegAnnotation(routeLeg: RouteLeg): List<ReplayEventBase>

Given a RouteLeg, use the LegAnnotation to create the speed and locations. To use this, your Directions request must include DirectionsCriteria.ANNOTATION_SPEED and DirectionsCriteria.ANNOTATION_DISTANCE

Link copied to clipboard
fun mapRouteLegGeometry(routeLeg: RouteLeg): List<ReplayEventBase>

Take a single RouteLeg from the DirectionsRoute and map it to a drive using the LegStep.geometry composed together.

Properties

Link copied to clipboard
var options: ReplayRouteOptions

Options that allow you to control the driver and car behavior