Disable elevation, as the limit is reached

pull/108/head
Candid Dauth 2017-08-23 11:44:10 +02:00
rodzic 12d1574f28
commit 7b0d6d0796
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -31,7 +31,9 @@ const elevation = module.exports = {
}, },
getElevationForPoints(points) { getElevationForPoints(points) {
if(points.length == 0) return Promise.resolve(points.map(() => (null)));
/*if(points.length == 0)
return Promise.resolve([ ]); return Promise.resolve([ ]);
let ret = Promise.resolve([ ]); let ret = Promise.resolve([ ]);
@ -50,10 +52,17 @@ const elevation = module.exports = {
}).then((res) => (heights.concat(res.height))); }).then((res) => (heights.concat(res.height)));
}); });
} }
return ret; return ret;*/
}, },
getAscentDescent(elevations) { getAscentDescent(elevations) {
if(!elevations.some((ele) => (ele != null))) {
return {
ascent: null,
descent: null
};
}
let ret = { let ret = {
ascent: 0, ascent: 0,
descent: 0 descent: 0