changed directions to walking / public transport

This commit is contained in:
Martin Donnelly 2018-10-11 17:21:50 +01:00
parent d9155aaca9
commit eb9c2e3762

View File

@ -10,7 +10,7 @@ const htmlTidy = /<(\/*?)(?!(em|p|br\s*\/|strong|h1|h2|h3))\w+?.+?>/gim;
function reduceEstDirections(body = '') { function reduceEstDirections(body = '') {
if (body === '') return {}; if (body === '') return {};
logger.debug(body); // logger.debug(body);
const jBody = JSON.parse(body); const jBody = JSON.parse(body);
const obj = {}; const obj = {};
const { ResultSet } = jBody; const { ResultSet } = jBody;
@ -43,15 +43,13 @@ function reduceEstDirections(body = '') {
obj.className = 'trafficNone'; obj.className = 'trafficNone';
} }
for (const item of route) for (const item of route) {
{
logger.debug(item); logger.debug(item);
if (item.street !== null) { if (item.hasOwnProperty('street')) {
const street = item.street.split(','); const street = item.street.split(',');
if (street[0] !== '') streets.push(street[0]); if (street[0] !== '') streets.push(street[0]);
} }
} }
obj.streets = uniq(streets); obj.streets = uniq(streets);
} }