Improve error-handling

This commit is contained in:
Richard Fairhurst 2014-03-08 12:07:54 +00:00
parent 902f1b0887
commit 5b6558c0f2
6 changed files with 22 additions and 7 deletions

View file

@ -17,7 +17,6 @@ OSM.RoutingEngines.list.push({
},
gotRoute: function(router, data) {
if (!data.info.routeFound) {
alert("Couldn't find route between those two places");
return false;
}
// Draw polyline
@ -36,6 +35,7 @@ OSM.RoutingEngines.list.push({
steps.push([{lat: latlng[0], lng: latlng[1]}, instrCode, instrText, distInMeter]);
}
router.setItinerary({steps: steps});
return true;
},
GH_INSTR_MAP: {
"-3": 6, // sharp left