[openstreetmap/openstreetmap-website] Add kilometers/miles switch to directions (PR #5915)
Minh Nguyễn
notifications at github.com
Fri Apr 11 16:19:50 UTC 2025
@1ec5 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) {
> You mean at 0.1 miles?
Yep, that was a typo, fixed. The difference between metric and non-metric in these SDKs is due to a large quantity like 999 meters still being comprehensible compared to 5,280 feet. Fewer digits helps too.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5915#discussion_r2039879862
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5915/review/2760884106 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250411/6fac2e08/attachment.htm>
More information about the rails-dev
mailing list