[openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)

Tom Hughes notifications at github.com
Thu Apr 10 16:36:44 UTC 2025


@tomhughes commented on this pull request.



>      } else {
-      return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) });
+      const ft = m / ftSize;
+      const mi = m / miSize;
+      if (ft < 1000) {

Is 1000 still the right boundary to use in feet/miles? It's very different to 1000m in terms of distance... Something like 3280 would be the equivalent, or alternatively 5280 if we wanted to stick to using minor units up to the first major unit.

Then again at least in the UK we're more likely to use yards than feet as the minor unit...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5915#pullrequestreview-2757505165
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5915/review/2757505165 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250410/290a38b9/attachment.htm>


More information about the rails-dev mailing list