public abstract class MapboxDirections
extends com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>
Requested routes can include as much as 25 coordinates anywhere on earth (except the traffic profile which support up to 3 coordinates, contact Mapbox Support if you'd like to extend this limit).
Requesting a route at a bare minimal must include, a Mapbox access token, destination, and an origin.
| Modifier and Type | Class and Description |
|---|---|
static class |
MapboxDirections.Builder
Builder class used to create a new instance of
MapboxDirections. |
| Modifier | Constructor and Description |
|---|---|
protected |
MapboxDirections() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
baseUrl() |
static MapboxDirections.Builder |
builder()
Build a new
MapboxDirections object. |
void |
enqueueCall(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Wrapper method for Retrofits
Call.enqueue(Callback) call returning a response specific
to the Directions API. |
retrofit2.Response<com.mapbox.api.directions.v5.models.DirectionsResponse> |
executeCall()
Wrapper method for Retrofits
Call.execute() call returning a response specific to the
Directions API synchronously. |
protected com.google.gson.GsonBuilder |
getGsonBuilder() |
protected okhttp3.OkHttpClient |
getOkHttpClient() |
protected retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> |
initializeCall() |
abstract MapboxDirections.Builder |
toBuilder()
Returns the builder which created this instance of
MapboxDirections and allows for
modification and building a new directions request with new information. |
protected java.lang.String baseUrl()
baseUrl in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>protected retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> initializeCall()
initializeCall in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>protected com.google.gson.GsonBuilder getGsonBuilder()
getGsonBuilder in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>public retrofit2.Response<com.mapbox.api.directions.v5.models.DirectionsResponse> executeCall()
throws java.io.IOException
Call.execute() call returning a response specific to the
Directions API synchronously.executeCall in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>java.io.IOException - Signals that an I/O exception of some sort has occurredpublic void enqueueCall(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Call.enqueue(Callback) call returning a response specific
to the Directions API.enqueueCall in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>callback - a Callback which is used once the DirectionsResponse is
created.protected okhttp3.OkHttpClient getOkHttpClient()
getOkHttpClient in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,com.mapbox.api.directions.v5.DirectionsService>public static MapboxDirections.Builder builder()
MapboxDirections object.MapboxDirections.Builder object for creating this objectpublic abstract MapboxDirections.Builder toBuilder()
MapboxDirections and allows for
modification and building a new directions request with new information.MapboxDirections.Builder with the same variables set as this directions object