alternatives work with zooming now
This commit is contained in:
parent
90c48abeaf
commit
80d2918203
@ -99,8 +99,9 @@ showRoute_Redraw: function(response) {
|
|||||||
//OSRM.G.response = response; // not needed, even harmful as important information is not stored!
|
//OSRM.G.response = response; // not needed, even harmful as important information is not stored!
|
||||||
//OSRM.RoutingAlternatives.prepare_Redraw(response);
|
//OSRM.RoutingAlternatives.prepare_Redraw(response);
|
||||||
if(response.status != 207) {
|
if(response.status != 207) {
|
||||||
OSRM.RoutingGeometry.show(response);
|
OSRM.RoutingAlternatives.prepare_Redraw(response);
|
||||||
OSRM.RoutingNoNames.show(response);
|
OSRM.RoutingGeometry.show(OSRM.G.response);
|
||||||
|
OSRM.RoutingNoNames.show(OSRM.Gresponse);
|
||||||
}
|
}
|
||||||
OSRM.Routing._updateHints(response);
|
OSRM.Routing._updateHints(response);
|
||||||
},
|
},
|
||||||
|
@ -53,14 +53,24 @@ prepare: function(response) {
|
|||||||
OSRM.RoutingAlternatives._addGUI();
|
OSRM.RoutingAlternatives._addGUI();
|
||||||
},
|
},
|
||||||
prepare_Redraw: function(response) {
|
prepare_Redraw: function(response) {
|
||||||
var original = {};
|
// do nothing if there is no alternative
|
||||||
original.route_geometry = response.route_geometry;
|
if( OSRM.G.alternative_count == 1 )
|
||||||
original.route_instructions = response.route_instructions;
|
return;
|
||||||
original.route_summary = response.route_summary;
|
|
||||||
OSRM.G.response.alternatives = response.alternatives;
|
|
||||||
OSRM.G.response.alternatives.push( original );
|
|
||||||
|
|
||||||
OSRM.RoutingAlternatives._addGUI();
|
// move results
|
||||||
|
var the_response = OSRM.G.response;
|
||||||
|
the_response.alternative_geometries = response.alternative_geometries;
|
||||||
|
the_response.alternative_instructions = response.alternative_instructions;
|
||||||
|
the_response.alternative_summaries = response.alternative_summaries;
|
||||||
|
|
||||||
|
the_response.alternative_geometries.unshift( response.route_geometry );
|
||||||
|
the_response.alternative_instructions.unshift( response.route_instructions );
|
||||||
|
the_response.alternative_summaries.unshift( response.route_summary );
|
||||||
|
|
||||||
|
// switch data
|
||||||
|
the_response.route_geometry = the_response.alternative_geometries[OSRM.G.alternative_active];
|
||||||
|
the_response.route_instructions = the_response.alternative_instructions[OSRM.G.alternative_active];
|
||||||
|
the_response.route_summary = the_response.alternative_summaries[OSRM.G.alternative_active];
|
||||||
},
|
},
|
||||||
|
|
||||||
// press one of the buttons
|
// press one of the buttons
|
||||||
|
Loading…
Reference in New Issue
Block a user