diff --git a/WebContent/base/osrm/OSRM.Marker.js b/WebContent/base/osrm/OSRM.Marker.js index 7b6d402e7..79664f9f6 100644 --- a/WebContent/base/osrm/OSRM.Marker.js +++ b/WebContent/base/osrm/OSRM.Marker.js @@ -81,6 +81,8 @@ OSRM.RouteMarker = function ( label, style, position ) { OSRM.inheritFrom( OSRM.RouteMarker, OSRM.Marker ); OSRM.extend( OSRM.RouteMarker, { onClick: function(e) { + OSRM.RoutingAlternatives.reset(); + for( var i=0; i OSRM.G.alternative_count - 1 ) + OSRM.G.active_alternative = 0; + + // 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]; +}, + // prepare using alternatives prepare: function(response) { // store basic information