map.removeLayer(polyline);
if (!dragging) {
- alert(I18n.t('javascripts.directions.errors.no_route'));
+ $('#sidebar_content').html('<p class="search_results_error">' + I18n.t('javascripts.directions.errors.no_route') + '</p>');
}
return;
]); // TODO does graphhopper map instructions onto line indices?
}
- callback(null, {
+ callback(false, {
line: line,
steps: steps,
distance: path.distance,
time: path.time / 1000
});
+ },
+ error: function () {
+ callback(true);
}
});
}
steps.push([L.latLng(s.startPoint.lat, s.startPoint.lng), d, s.narrative, s.distance * 1000, lineseg]);
}
- callback(null, {
+ callback(false, {
line: line,
steps: steps,
distance: data.route.distance * 1000,
time: data.route.time
});
+ },
+ error: function () {
+ callback(true);
}
});
}
} else {
callback(true);
}
+ },
+ error: function () {
+ callback(true);
}
});
}
steps.push([line[s[3]], s[0].split('-')[0], instText, s[2], line.slice(s[3], linesegend)]);
}
- callback(null, {
+ callback(false, {
line: line,
steps: steps,
distance: data.route_summary.total_distance,
time: data.route_summary.total_time
});
+ },
+ error: function () {
+ callback(true);
}
});
}