From 1a047b99f5f1aaf66b99b06c804f89828e2e0e83 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 15 Jun 2025 15:53:17 +0300 Subject: [PATCH] Prepare for extra miles subunit --- app/assets/javascripts/index/directions-route-output.js | 8 ++++---- app/views/directions/show.html.erb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/index/directions-route-output.js b/app/assets/javascripts/index/directions-route-output.js index f3de773e1..9caf89404 100644 --- a/app/assets/javascripts/index/directions-route-output.js +++ b/app/assets/javascripts/index/directions-route-output.js @@ -13,14 +13,14 @@ OSM.DirectionsRouteOutput = function (map) { weight: 12 }); - let distanceUnits = "km"; + let distanceUnits = "km_m"; let downloadURL = null; function translateDistanceUnits(m) { - if (distanceUnits === "km") { - return [m, "m", m / 1000, "km"]; - } else { + if (distanceUnits === "mi_ft") { return [m / 0.3048, "ft", m / 1609.344, "mi"]; + } else { + return [m, "m", m / 1000, "km"]; } } diff --git a/app/views/directions/show.html.erb b/app/views/directions/show.html.erb index 5841f7037..74f2dc2a9 100644 --- a/app/views/directions/show.html.erb +++ b/app/views/directions/show.html.erb @@ -91,11 +91,11 @@