public abstract class FasterRoute extends Object
To provide your implementation,
use MapboxNavigation.setFasterRouteEngine(FasterRoute)
.
shouldCheckFasterRoute(Location, RouteProgress)
determines how quickly a
new route will be fetched by RouteFetcher
.
isFasterRoute(DirectionsResponse, RouteProgress)
determines if the new route
retrieved by RouteFetcher
is actually faster than the current route.
Constructor and Description |
---|
FasterRoute() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
isFasterRoute(com.mapbox.api.directions.v5.models.DirectionsResponse response,
RouteProgress routeProgress)
This method will be used to determine if the route retrieved is
faster than the one that's currently being navigated.
|
abstract boolean |
shouldCheckFasterRoute(Location location,
RouteProgress routeProgress)
This method determine if a new
DirectionsResponse should
be retrieved by RouteFetcher . |
public abstract boolean shouldCheckFasterRoute(Location location, RouteProgress routeProgress)
DirectionsResponse
should
be retrieved by RouteFetcher
.
It will also be called every time
the NavigationEngine gets a valid Location
update.
The most recent snapped location and route progress are provided. Both can be used to determine if a new route should be fetched or not.
location
- current snapped locationrouteProgress
- current route progresspublic abstract boolean isFasterRoute(com.mapbox.api.directions.v5.models.DirectionsResponse response, RouteProgress routeProgress)
response
- provided by RouteFetcher
routeProgress
- current route progress© 2019 Mapbox. All rights reserved.