Read time/energy calc variables from profile

and ensure profile text is loaded before updating route and straight line stats
This commit is contained in:
Norbert Renner 2022-02-15 19:30:49 +01:00
parent 9abf4b94c4
commit 4d44153316
5 changed files with 57 additions and 20 deletions

View file

@ -7,7 +7,13 @@ const geoJson = require('../format/data/track.json');
test('simple track', () => {
const coordinates = geoJson.features[0].geometry.coordinates;
const properties = geoJson.features[0].properties;
const rc = new BR.RoutingContext();
const dummyProfileVars = {
getProfileVar(name) {
const vars = { validForBikes: 1 };
return vars[name];
},
};
const rc = new BR.RoutingContext(dummyProfileVars);
const stdPath = new BR.StdPath();
for (let i = 0; i < coordinates.length; i++) {