diff --git a/DataStructures/TurnInstructions.h b/DataStructures/TurnInstructions.h index c421fc0b8..76f5244f2 100644 --- a/DataStructures/TurnInstructions.h +++ b/DataStructures/TurnInstructions.h @@ -40,8 +40,9 @@ struct TurnInstructionsClass { const static short EnterRoundAbout = 11; const static short LeaveRoundAbout = 12; const static short StayOnRoundAbout = 13; + const static short StartAtEndOfStreet = 14; - std::string TurnStrings[14]; + std::string TurnStrings[15]; std::string Ordinals[11]; //This is a hack until c++0x is available enough to use initializer lists. @@ -60,6 +61,7 @@ struct TurnInstructionsClass { TurnStrings[11] = "Enter round-about"; TurnStrings[12] = "Leave round-about"; TurnStrings[13] = "Stay on round-about"; + TurnStrings[14] = "Start"; Ordinals[0] = "zeroth"; Ordinals[1] = "first"; @@ -105,48 +107,6 @@ struct TurnInstructionsClass { return true; } - // static inline void getDirectionOfInstruction(double angle, DirectionOfInstruction & dirInst) { - // if(angle >= 23 && angle < 67) { - // dirInst.direction = "southeast"; - // dirInst.shortDirection = "SE"; - // return; - // } - // if(angle >= 67 && angle < 113) { - // dirInst.direction = "south"; - // dirInst.shortDirection = "S"; - // return; - // } - // if(angle >= 113 && angle < 158) { - // dirInst.direction = "southwest"; - // dirInst.shortDirection = "SW"; - // return; - // } - // if(angle >= 158 && angle < 202) { - // dirInst.direction = "west"; - // dirInst.shortDirection = "W"; - // return; - // } - // if(angle >= 202 && angle < 248) { - // dirInst.direction = "northwest"; - // dirInst.shortDirection = "NW"; - // return; - // } - // if(angle >= 248 && angle < 292) { - // dirInst.direction = "north"; - // dirInst.shortDirection = "N"; - // return; - // } - // if(angle >= 292 && angle < 336) { - // dirInst.direction = "northeast"; - // dirInst.shortDirection = "NE"; - // return; - // } - // dirInst.direction = "East"; - // dirInst.shortDirection = "E"; - // return; - // } - // - }; static TurnInstructionsClass TurnInstructions; diff --git a/Descriptors/DescriptionFactory.cpp b/Descriptors/DescriptionFactory.cpp index 3467da3af..c6c19612e 100644 --- a/Descriptors/DescriptionFactory.cpp +++ b/Descriptors/DescriptionFactory.cpp @@ -94,6 +94,10 @@ unsigned DescriptionFactory::Run(const unsigned zoomLevel) { indexOfSegmentBegin = i; } } + if(pathDescription[0].length == 0){ + INFO("Start at End of street"); + pathDescription[0].turnInstruction = 14; + } //Generalize poly line dp.Run(pathDescription, zoomLevel); diff --git a/Docs/WebFrontend/Route.js b/Docs/WebFrontend/Route.js index 1aea2bd1c..71acde7eb 100644 --- a/Docs/WebFrontend/Route.js +++ b/Docs/WebFrontend/Route.js @@ -29,7 +29,6 @@ //====================== // OBJECTS //Map -//var HOST_ROUTING_URL = 'http://localhost:5000/viaroute'; var HOST_ROUTING_URL = 'http://routingdemo.geofabrik.de/route-via/'; var HOST_WEBSITE = 'http://map.project-osrm.org/';//location.host @@ -100,7 +99,9 @@ function reroute() { */ function showResultsDragRoute(response) { if (response) { - //Display Route showRouteGeometry(response); } + //Display Route + showRouteGeometry(response); + } markersLayer.clearMarkers(); ISCALCULATING = false; } @@ -149,16 +150,32 @@ function showResultsRoute(response) { //Show Route Instructions output += '
1. | '+response.route_instructions[0][0]+' on '+response.route_instructions[0][1]; + if(response.route_instructions[0][2] != 0) + output += ' for '+getDistanceWithUnit(response.route_instructions[0][2]); + output += ' |
'+(i+1)+'. | '+response.route_instructions[i][0]+' on '+response.route_instructions[i][1]+' for '+getDistanceWithUnit(response.route_instructions[i][2])+' |
'+(i+1)+'. | '+response.route_instructions[i][0]+' on '+response.route_instructions[i][1]+' for '+getDistanceWithUnit(response.route_instructions[i][2])+' |