diff --git a/WebContent/routing/OSRM.RoutingAlternatives.js b/WebContent/routing/OSRM.RoutingAlternatives.js index 1c556aeac..6de958cfb 100644 --- a/WebContent/routing/OSRM.RoutingAlternatives.js +++ b/WebContent/routing/OSRM.RoutingAlternatives.js @@ -37,9 +37,12 @@ init: function() { prepare: function(response) { // move best route to alternative array var the_response = OSRM.G.response; + the_response.route_name = ["Temporary Value"]; + the_response.alternative_names = [ ["Temporary Value2"] ]; the_response.alternative_geometries.unshift( response.route_geometry ); the_response.alternative_instructions.unshift( response.route_instructions ); the_response.alternative_summaries.unshift( response.route_summary ); + the_response.alternative_names.unshift( response.route_name ); // update basic information OSRM.G.alternative_count = response.alternative_geometries.length; @@ -49,7 +52,8 @@ prepare: function(response) { // switch data the_response.route_geometry = the_response.alternative_geometries[OSRM.G.active_alternative]; the_response.route_instructions = the_response.alternative_instructions[OSRM.G.active_alternative]; - the_response.route_summary = the_response.alternative_summaries[OSRM.G.active_alternative]; + the_response.route_summary = the_response.alternative_summaries[OSRM.G.active_alternative]; + the_response.route_name = the_response.alternative_names[OSRM.G.active_alternative]; }, // switch active alternative and redraw buttons accordingly @@ -73,7 +77,10 @@ show: function() { for(var i=0, size=OSRM.G.alternative_count; i'+buttons[i].label+'' + data; } @@ -104,6 +111,7 @@ _click: function(button_id) { the_response.route_geometry = the_response.alternative_geometries[button_id]; the_response.route_instructions = the_response.alternative_instructions[button_id]; the_response.route_summary = the_response.alternative_summaries[button_id]; + the_response.route_name = the_response.alternative_names[button_id]; // redraw route & data OSRM.RoutingGeometry.show(the_response);