Fix route/bearing param
This commit is contained in:
parent
5647e6c199
commit
164fb09f2c
@ -57,9 +57,11 @@ module.exports = function () {
|
|||||||
params.coordinates = encodedWaypoints;
|
params.coordinates = encodedWaypoints;
|
||||||
|
|
||||||
if (bearings.length) {
|
if (bearings.length) {
|
||||||
// TODOTODO
|
params.bearings = bearings.map(b => {
|
||||||
var encodedBearings = bearings.map(b => ['b', b.toString()]);
|
var bs = b.split(',');
|
||||||
params = Array.prototype.concat.apply(params, encodedWaypoints.map((o, i) => [o, encodedBearings[i]]));
|
if (bs.length === 2) return b;
|
||||||
|
else return b += ',10';
|
||||||
|
}).join(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.requestPath('route', params, callback);
|
return this.requestPath('route', params, callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user