printing and alternatives works!

This commit is contained in:
DennisSchiefer 2012-07-03 15:17:29 +01:00
parent 537b9b0623
commit c33dbe67d8

View File

@ -187,13 +187,15 @@ show: function(response) {
// draw route & query for better geometry
print_window.OSRM.drawRoute( positions );
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&z='+zoom+'&instructions=false', OSRM.Printing.drawRoute, OSRM.Printing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'print');
// NOTE: simply appended correct zoom level as second zoom parameter to JSONP call -> OSRM API only considers the last one!
// NOTE: correct zoom level was appended as second zoom parameter to JSONP call -> OSRM API only considers the last one!
},
timeoutRoute: function() {},
drawRoute: function(response) {
if(!response)
return;
var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5);
response.alternative_geometries.unshift( response.route_geometry );
positions = OSRM.RoutingGeometry._decode( response.alternative_geometries[ OSRM.G.active_alternative ], 5 );
OSRM.G.printwindow.OSRM.drawRoute( positions );
},