-
Notifications
You must be signed in to change notification settings - Fork 117
Directions Refresh new implementation #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a compilation error when running this because route / leg index are defined as Strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo other *then
2e1fbba to
9085c51
Compare
9085c51 to
ad63326
Compare
danesfeder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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