]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/osrm.js
Add distance/time summary
[rails.git] / app / assets / javascripts / routing_engines / osrm.js
index fde871019917d671f699eb154619412dd74f191b..041f456f0ba9c6a474d42232d3f072149e12d82a 100644 (file)
@@ -46,7 +46,7 @@ OSRMEngine.prototype.createConfig = function() {
                                if (instCodes[0]!=15) { instText+=s[1] ? "<b>"+s[1]+"</b>" : I18n.t('javascripts.directions.instructions.unnamed'); }
                                steps.push([line[s[3]], s[0].split('-')[0], instText, s[2]]);
                        }
-                       if (steps.length) router.setItinerary({ steps: steps });
+                       if (steps.length) router.setItinerary({ steps: steps, distance: data.route_summary.total_distance, time: data.route_summary.total_time });
                        return true;
                }
        };