Implements Alternatives for MLD

This commit is contained in:
Daniel J. Hofmann
2017-04-06 14:28:43 +02:00
committed by Patrick Niklaus
parent fef0344be0
commit 54ceb05420
28 changed files with 1404 additions and 238 deletions
+8 -2
View File
@@ -55,7 +55,7 @@ test('route: throws with too few or invalid args', function(assert) {
});
test('route: provides no alternatives by default, but when requested it may (not guaranteed)', function(assert) {
assert.plan(6);
assert.plan(9);
var osrm = new OSRM(monaco_path);
var options = {coordinates: two_test_coordinates};
@@ -70,6 +70,12 @@ test('route: provides no alternatives by default, but when requested it may (not
assert.ok(route.routes);
assert.ok(route.routes.length >= 1);
});
options.alternatives = 3;
osrm.route(options, function(err, route) {
assert.ifError(err);
assert.ok(route.routes);
assert.ok(route.routes.length >= 1);
});
});
test('route: throws with bad params', function(assert) {
@@ -542,4 +548,4 @@ test('route: throws on bad approaches', function(assert) {
approaches: [10, 15]
}, function(err, route) {}) },
/Approach must be a string: \[curb, unrestricted\] or null/);
});
});