Add node_osrm support for skip_waypoints parameter (#6060)

This commit is contained in:
Maciej Bukczynski
2022-08-22 12:47:47 -07:00
committed by GitHub
parent 928867c520
commit 32fb8607e4
3 changed files with 35 additions and 1 deletions
+17 -1
View File
@@ -130,7 +130,7 @@ tables.forEach(function(annotation) {
});
test('table: ' + annotation + ' throws on invalid arguments', function(assert) {
assert.plan(17);
assert.plan(18);
var osrm = new OSRM(data_path);
var options = {annotations: [annotation.slice(0,-1)]};
assert.throws(function() { osrm.table(options); },
@@ -190,6 +190,8 @@ tables.forEach(function(annotation) {
assert.throws(function() { osrm.route({coordinates: two_test_coordinates, generate_hints: null}, function(err, route) {}) },
/generate_hints must be of type Boolean/);
assert.throws(function() { osrm.route({coordinates: two_test_coordinates, skip_waypoints: null}, function(err, route) {}) },
/skip_waypoints must be of type Boolean/);
});
test('table: throws on invalid arguments', function(assert) {
@@ -239,6 +241,20 @@ tables.forEach(function(annotation) {
});
});
test('table: ' + annotation + ' table in Monaco without waypoints', function(assert) {
assert.plan(2);
var osrm = new OSRM(data_path);
var options = {
coordinates: two_test_coordinates,
skip_waypoints: true, // false is default
annotations: [annotation.slice(0,-1)]
};
osrm.table(options, function(err, table) {
assert.strictEqual(table.sources, undefined);
assert.strictEqual(table.destinations, undefined);
});
});
test('table: ' + annotation + ' table in Monaco without motorways', function(assert) {
assert.plan(2);
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});