MapboxTripProgressApi

class MapboxTripProgressApi

Used for calculating data needed for trip progress.

Parameters

formatter
processor

an instance of TripProgressProcessor

Constructors

Link copied to clipboard
fun MapboxTripProgressApi(formatter: TripProgressUpdateFormatter)

Functions

Link copied to clipboard
fun getTripDetails(route: NavigationRoute): Expected<TripOverviewError, TripOverviewValue>

Calculates trip details based on NavigationRoute. The return value contains leg time, leg duration and estimated time to arrival for each RouteLeg in NavigationRoute.directionsRoute in the form of RouteLegTripOverview. It also contains totalTime, totalDistance and totalEstimatedTimeToArrival for the entire NavigationRoute.directionsRoute

Link copied to clipboard
fun getTripProgress(routeProgress: RouteProgress): TripProgressUpdateValue

Calculates a trip progress update based on a RouteProgress

Properties

Link copied to clipboard
var formatter: TripProgressUpdateFormatter