X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7f8025667b13877ba8dbe4f7457e98402977abbf..1f13321a60239881f7016044b79e9a4d58045e30:/app/assets/javascripts/index/directions.js
diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js
index bdba41ec2..dd408debc 100644
--- a/app/assets/javascripts/index/directions.js
+++ b/app/assets/javascripts/index/directions.js
@@ -28,6 +28,20 @@ OSM.Directions = function (map) {
var expiry = new Date();
expiry.setYear(expiry.getFullYear() + 10);
+ var engines = OSM.Directions.engines;
+
+ engines.sort(function (a, b) {
+ a = I18n.t('javascripts.directions.engines.' + a.id);
+ b = I18n.t('javascripts.directions.engines.' + b.id);
+ return a.localeCompare(b);
+ });
+
+ var select = $('select.routing_engines');
+
+ engines.forEach(function(engine, i) {
+ select.append("");
+ });
+
function Endpoint(input, iconUrl) {
var endpoint = {};
@@ -60,7 +74,7 @@ OSM.Directions = function (map) {
input.on("change", function (e) {
awaitingGeocode = true;
-
+
// make text the same in both text boxes
var value = e.target.value;
endpoint.setValue(value);
@@ -245,7 +259,6 @@ OSM.Directions = function (map) {
.html(html);
// Add each row
- var cumulative = 0;
route.steps.forEach(function (step) {
var ll = step[0],
direction = step[1],
@@ -253,8 +266,6 @@ OSM.Directions = function (map) {
dist = step[3],
lineseg = step[4];
- cumulative += dist;
-
if (dist < 5) {
dist = "";
} else if (dist < 200) {
@@ -304,20 +315,6 @@ OSM.Directions = function (map) {
});
}
- var engines = OSM.Directions.engines;
-
- engines.sort(function (a, b) {
- a = I18n.t('javascripts.directions.engines.' + a.id);
- b = I18n.t('javascripts.directions.engines.' + b.id);
- return a.localeCompare(b);
- });
-
- var select = $('select.routing_engines');
-
- engines.forEach(function(engine, i) {
- select.append("");
- });
-
var chosenEngineIndex = findEngine('fossgis_osrm_car');
if ($.cookie('_osm_directions_engine')) {
chosenEngineIndex = findEngine($.cookie('_osm_directions_engine'));