-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix annotations=true handling in NodeJS bindings & libosrm #6415
Changes from 3 commits
94f0d53
c7bf2a5
1ffb676
67b80e6
567be2e
7d5954f
4a70ac2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -286,9 +286,9 @@ test('route: routes Monaco with several (duration, distance, nodes) annotations | |||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.distance;}), 'every leg has annotations for distance'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.duration;}), 'every leg has annotations for durations'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.nodes;}), 'every leg has annotations for nodes'); | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.weight; }), 'has no annotations for weight') | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.datasources; }), 'has no annotations for datasources') | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.speed; }), 'has no annotations for speed') | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.weight; }), 'has no annotations for weight'); | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.datasources; }), 'has no annotations for datasources'); | ||||
assert.notOk(first.routes[0].legs.every(l => { return l.annotation.speed; }), 'has no annotations for speed'); | ||||
|
||||
options.overview = 'full'; | ||||
osrm.route(options, function(err, full) { | ||||
|
@@ -303,7 +303,7 @@ test('route: routes Monaco with several (duration, distance, nodes) annotations | |||
}); | ||||
|
||||
test('route: routes Monaco with options', function(assert) { | ||||
assert.plan(11); | ||||
assert.plan(17); | ||||
var osrm = new OSRM(monaco_path); | ||||
var options = { | ||||
coordinates: two_test_coordinates, | ||||
|
@@ -322,6 +322,12 @@ test('route: routes Monaco with options', function(assert) { | |||
assert.ok(first.routes[0].legs[0]); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.steps.length > 0; }), 'every leg has steps'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation;}), 'every leg has annotations'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.distance;}), 'every leg has annotations for distance'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.duration;}), 'every leg has annotations for durations'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.nodes;}), 'every leg has annotations for nodes'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.weight; }), 'every leg has annotations for weight'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.datasources; }), 'every leg has annotations for datasources'); | ||||
assert.ok(first.routes[0].legs.every(l => { return l.annotation.speed; }), 'every leg has annotations for speed'); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw problem was happening only for osrm-backend/include/engine/api/route_api.hpp Line 770 in 5e5f1f4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It looks as a bug, because it is different from other annotations, so I changed it to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, looks like it. |
||||
|
||||
options.overview = 'full'; | ||||
osrm.route(options, function(err, full) { | ||||
|
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 would remove this
annotations
boolean field completely, but it seems it would break libosrm backward compatibilityThere 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.
We should think about all the breaking changes we would make for a v6 release.
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.
Heh, it's already there: #3644