Skip to content

fixes ordering of the bearings - #455

Merged
danesfeder merged 3 commits into
masterfrom
cam-fix-nav-ui-bearing
Oct 31, 2017
Merged

danesfeder merged 3 commits into
masterfrom
cam-fix-nav-ui-bearing

Conversation

@cammace

@cammace cammace commented Oct 31, 2017

Copy link
Copy Markdown

No description provided.

@cammace
cammace requested a review from danesfeder October 31, 2017 18:20
@cammace cammace self-assigned this Oct 31, 2017
@cammace cammace added this to the v0.7.0 milestone Oct 31, 2017

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

Copy link
Copy Markdown
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
Copy Markdown
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

.accessToken(Mapbox.getAccessToken());

if (locationHasBearing()) {
fetchRouteWithBearing(routeBuilder, origin);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 done
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