Directions Refresh new implementation#955
Conversation
fa6d4e1 to
9a320a9
Compare
c0d0fd0 to
9fb2ef2
Compare
9fb2ef2 to
8aceed9
Compare
|
@Guardiola31337 @danesfeder this is ready for review. The sample test runs properly when adjusted to run on staging. See |
danesfeder
left a comment
There was a problem hiding this comment.
This is looking great, thanks for the work keeping this moving with @gknisely.
The directions-refresh response is basically a barebones
DirectionsRoute, which only includes a list of barebonesRouteLegs, which only include the requestedLegAnnotations.
My only question is regarding this - if we are only getting a List of LegAnnotation, does it make sense to return just that? If that's the case, I think it would be more clear to developers using the response data.
| public static Builder builder() { | ||
| return new AutoValue_MapboxDirectionsRefresh.Builder() | ||
| .baseUrl(Constants.BASE_API_URL) | ||
| .routeIndex(0) |
There was a problem hiding this comment.
I'm getting a compilation error when running this because route / leg index are defined as Strings
There was a problem hiding this comment.
@danesfeder this is updated now. Also it's running on production now so the sample test should pass
f3cf149 to
bc6d50e
Compare
|
@devotaaabel & @danesfeder , if needed, please don't forget about updating content on https://docs.mapbox.com/android/java/overview/directions given this pr's changes. thank you |
| public abstract Builder clientAppName(@NonNull String clientAppName); | ||
|
|
||
| /** | ||
| * Optionally change the APIs base URL to something other then the default Mapbox one. |
2e1fbba to
9085c51
Compare
9085c51 to
ad63326
Compare
danesfeder
left a comment
There was a problem hiding this comment.
@devotaaabel great work here - let's do one last sanity check with the updated v1 endpoint before we merge. Otherwise, this is good to go ✅
Guardiola31337
left a comment
There was a problem hiding this comment.
let's do one last sanity check with the updated
v1endpoint before we merge
I've just run the BasicDirectionsRefresh sample and it worked so we're good here 🚀
Great work @devotaaabel ![]()
This PR creates the infrastructure to allow updating routes with updated annotations via the directions-refresh endpoint (This endpoint is currently only on staging). Included in this PR:
A directions request can contain a new boolean parameter
enable_refresh. If this parameter is set to true, the route will be cached and will be refreshable via the directions-refresh endpoint.The directions-refresh request needs to include the
route_id,route_index,leg_index,access_token, and whateverannotationsneeded.The directions-refresh response is basically a barebones
DirectionsRoute, which only includes a list of barebonesRouteLegs, which only include the requestedLegAnnotations.Todo:
enable_refreshoption to directions APIDirectionsRefreshservice module