public class RouteFetcher extends Object
Location
origin and
RouteOptions
provided by a RouteProgress
.Constructor and Description |
---|
RouteFetcher(Context context,
String accessToken) |
Modifier and Type | Method and Description |
---|---|
void |
addRouteListener(RouteListener listener)
Adds a
RouteListener to this class to be triggered when a route
response has been received. |
void |
cancelRouteCall()
Cancels the Directions API call if it has not been executed yet.
|
void |
clearListeners()
Clears any listeners that have been added to this class via
addRouteListener(RouteListener) . |
void |
findRouteFromRouteProgress(Location location,
RouteProgress routeProgress)
|
public void addRouteListener(RouteListener listener)
RouteListener
to this class to be triggered when a route
response has been received.listener
- to be addedpublic void clearListeners()
addRouteListener(RouteListener)
.public void findRouteFromRouteProgress(Location location, RouteProgress routeProgress)
DirectionsRoute
given
the current Location
and RouteProgress
along the route.
Uses RouteOptions.coordinates()
and RouteProgress.remainingWaypoints()
to determine the amount of remaining waypoints there are along the given route.
location
- current location of the devicerouteProgress
- for remaining waypoints along the routepublic void cancelRouteCall()
© 2019 Mapbox. All rights reserved.