Skip to content
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

fixes ordering of the bearings #455

Merged
merged 3 commits into from
Oct 31, 2017
Merged

fixes ordering of the bearings #455

merged 3 commits into from
Oct 31, 2017

Conversation

cammace
Copy link
Contributor

@cammace cammace commented Oct 31, 2017

No description provided.

@cammace cammace self-assigned this Oct 31, 2017
@cammace cammace added this to the v0.7.0 milestone Oct 31, 2017
@@ -139,6 +139,7 @@ public void onMilestoneEvent(RouteProgress routeProgress, String instruction, in

@Override
public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {
Timber.d(call.request().url().toString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to keep this log in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just leave it, it's in the testapp

@@ -95,14 +95,14 @@ public void fetchRouteNewOrigin(Point newOrigin) {
private void fetchRoute(Point origin, Point destination) {
if (origin != null && destination != null) {
NavigationRoute.Builder routeBuilder = NavigationRoute.builder()
.accessToken(Mapbox.getAccessToken())
.destination(destination);
.accessToken(Mapbox.getAccessToken());

if (locationHasBearing()) {
fetchRouteWithBearing(routeBuilder, origin);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The builder finishes building in fetchRouteWithBearing and fetchRouteWithoutBearing, so in this case, the destination will never be added. Adding the destination in those methods would fix this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good catch

routeBuilder.destination(destination);
NavigationRoute.builder()
.accessToken(Mapbox.getAccessToken())
.origin(origin, bearing, 90d)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will adding a null bearing but still including a 90 degree tolerance have any effect on the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be an issue since in the directions SDK we have a check:

if(angle != null && tolerance != null) {
  this.bearings.add(new Double[]{angle, tolerance});
} else {
  this.bearings.add(new Double[0]);
}

if either value is null, we essentially skip the bearing value in the URL with a simple ; which is what is specified in the spec.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, looks good to go then 🚗

@danesfeder danesfeder merged commit 69d27d3 into master Oct 31, 2017
@danesfeder danesfeder deleted the cam-fix-nav-ui-bearing branch October 31, 2017 22:12
Grsmto pushed a commit to Grsmto/mapbox-navigation-android that referenced this pull request Nov 2, 2017
* cam-upgrade-project:
  Changed location engine imports
  changed to 0.2 location layer version
  fixes ordering of the bearings (mapbox#455)
  Updated Maneuver Icons  (mapbox#445)
  Change feedback timing (mapbox#442)
  changed apk filepath
  changed sonarqube version to work with gradle 3.0
  fixed a few test issues
  upgraded to gradle 3.0
@danesfeder danesfeder mentioned this pull request Nov 13, 2017
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants