public final class NavigationRoute extends Object
MapboxDirections
class with parameters which
must be set in order for a navigation session to successfully begin. While it is possible
to pass in any DirectionsRoute
into
MapboxNavigation.startNavigation(DirectionsRoute)
, using this class will ensure your
request includes all the proper information needed for the navigation session to begin.
Developer Note: MapboxDirections cannot be directly extended since it is an AutoValue class.
0.5.0Modifier and Type | Class and Description |
---|---|
static class |
NavigationRoute.Builder
This builder is used to create a new request to the Mapbox Directions API and removes options
which would cause this navigation SDK to not behave properly.
|
Modifier and Type | Method and Description |
---|---|
static NavigationRoute.Builder |
builder(Context context)
Build a new
NavigationRoute object with the proper navigation parameters already setup. |
void |
cancelCall()
Wrapper method for Retrofit's
Call.cancel() call, important to manually cancel call if
the user dismisses the calling activity or no longer needs the returned results. |
retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> |
getCall()
Wrapper method for Retrofit's
Call.clone() call, useful for getting call information
and allowing you to perform additional functions on this NavigationRoute class. |
void |
getRoute(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Call when you have constructed your navigation route with your desired parameters.
|
public static NavigationRoute.Builder builder(Context context)
NavigationRoute
object with the proper navigation parameters already setup.NavigationRoute.Builder
object for creating this objectpublic void getRoute(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Callback
must be passed into the method to handle both the response and failure.callback
- a RetroFit callback which contains an onResponse and onFailurepublic retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> getCall()
Call.clone()
call, useful for getting call information
and allowing you to perform additional functions on this NavigationRoute
class.public void cancelCall()
Call.cancel()
call, important to manually cancel call if
the user dismisses the calling activity or no longer needs the returned results.© 2019 Mapbox. All rights reserved.