[openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)
Anton Khorev
notifications at github.com
Fri Apr 11 10:11:16 UTC 2025
@AntonKhorev 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) {
0.1 miles is where Google Maps are switching. The logic is probably the lowest pretty number in major units that doesn't let minor units go into four digits.
0.2 miles from https://github.com/openstreetmap/openstreetmap-website/pull/1747 was a close candidate that allowed a small range of 4 digit numbers.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5915#discussion_r2039242997
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5915/review/2759851144 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250411/ae505460/attachment-0001.htm>
More information about the rails-dev
mailing list