printing and alternatives works!
This commit is contained in:
		
							parent
							
								
									537b9b0623
								
							
						
					
					
						commit
						c33dbe67d8
					
				| @ -187,13 +187,15 @@ show: function(response) { | |||||||
| 	// draw route & query for better geometry
 | 	// draw route & query for better geometry
 | ||||||
| 	print_window.OSRM.drawRoute( positions ); | 	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'); | 	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() {}, | timeoutRoute: function() {}, | ||||||
| drawRoute: function(response) { | drawRoute: function(response) { | ||||||
| 	if(!response) | 	if(!response) | ||||||
| 		return; | 		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 ); | 	OSRM.G.printwindow.OSRM.drawRoute( positions ); | ||||||
| }, | }, | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user