[openstreetmap/openstreetmap-website] Map: Add directional arrows to ways (PR #6400)
Tobias
notifications at github.com
Fri Sep 19 12:43:02 UTC 2025
### Description
Whenever I review OSM data that has some kind of direction tag eg `cycleway:right=lane` I have to switch to iD in order to see the direction of the way. This DRAFT shows how we could add direction indicators on the map using the existing leaflet setup with two leaflet plugins.
* https://github.com/slutske22/leaflet-arrowheads
* which also requires https://github.com/makinacorpus/Leaflet.GeometryUtil
I am pretty sure this PR is not wat we want from a code point of view but rather have this function added to https://github.com/openstreetmap/leaflet-osm (right?)
So for now this is just a draft to get directions on if this is something that is worth continuing on and if it actually belongs in `leaflet-osm`.
### How has this been tested?
This is what it looks like with those changes:
- http://localhost:3001/way/29892612
<img width="1670" height="1436" alt="way" src="https://github.com/user-attachments/assets/dcb1941f-7792-4898-baa1-9354079c5d04" />
- http://localhost:3001/way/289093405
<img width="782" height="616" alt="area" src="https://github.com/user-attachments/assets/f7307907-8f13-4fc7-b321-f59d877508a8" />
- http://localhost:3001/node/1670728448
<img width="818" height="614" alt="point" src="https://github.com/user-attachments/assets/52812953-0518-4118-b253-a4e34090bfa7" />
- http://localhost:3001/relation/11612537
<img width="1630" height="1394" alt="relation" src="https://github.com/user-attachments/assets/f60abc2f-901e-4409-9d2f-bf11a7dca834" />
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/6400
-- Commit Summary --
* Map: Add directional arrows to ways
-- File Changes --
M Vendorfile (9)
M app/assets/javascripts/index.js (2)
M app/assets/javascripts/leaflet.map.js (12)
A vendor/assets/leaflet/leaflet.arrowheads.js (691)
A vendor/assets/leaflet/leaflet.geometryutil.js (807)
M vendor/assets/leaflet/leaflet.osm.js (5)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/6400.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6400.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6400
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6400 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250919/3182c5da/attachment.htm>
More information about the rails-dev
mailing list