Skip to content

Show blue contraflow arrow for oneway:bicycle=no on one-way ways#2

Closed
tordans wants to merge 1 commit into
masterfrom
cursor/bicycle-oneway-reverse-arrow-2126
Closed

Show blue contraflow arrow for oneway:bicycle=no on one-way ways#2
tordans wants to merge 1 commit into
masterfrom
cursor/bicycle-oneway-reverse-arrow-2126

Conversation

@tordans
Copy link
Copy Markdown
Owner

@tordans tordans commented May 30, 2026

Problem

On one-way streets that allow contraflow cycling (oneway=yes + oneway:bicycle=no, or oneway=-1 with the same bicycle tag), Go Map!! today shows only a single black chevron for the general (motor) direction. Mappers cannot see at a glance that cyclists may legally travel the opposite way without opening the POI editor.

This is a common tagging pattern on urban cycle infrastructure (one-way street with contraflow cycling). We want the map to communicate “cars this way, bikes both ways” directly on the canvas.

Implementation notes (Cursor)

  • OSM key: oneway:bicycle (documented in code above allowsBicycleContraflow()).
  • Added OsmWay.allowsBicycleContraflow() — returns true when isOneWay != .NONE and tags["oneway:bicycle"] == "no". Does not change computeIsOneWay() / turn-restriction logic.
  • Refactored one-way chevron drawing in EditorMapLayer into makeOneWayArrowLayer(at:direction:chevronLength:alongWayOffset:fillColor:zPosition:).
  • Black arrow: motor/general direction at the sampled point on the way.
  • Blue arrow: opposite direction, shifted along the way behind the black tip (< then > on the same centerline; longitudinal offset chevron length so the pair does not overlap). Black is drawn on top of blue.
  • Placed along the way with the same invoke(alongScreenClippedWay:offset:interval:) spacing as today (offset 50, interval 100).

Out of scope (follow-up): other mode-specific exceptions (oneway:foot, oneway:bus, …).

Testing notes (@tordans)

  1. Find or create a way with oneway=yes and oneway:bicycle=no like https://www.openstreetmap.org/way/25509293 — expect tandem < (blue) > (black) on the same line along the way (not offset above/below the road).
  2. Same tags with oneway=-1 — black points backward; blue forward, still inline behind black along the way. – did not test, assumed correct
  3. oneway=yes without oneway:bicycle=no — only the black chevron (no regression).
  4. oneway:bicycle=no on a non-one-way way — no arrows (unless highlighted by selection) – did not test, assumed correct
  5. Zoom in/out and pan — chevrons stay aligned on the way centerline and remain readable.
Before After
https://github.com/user-attachments/assets/481a70b3-7474-4c09-a93f-fe72e7eb95af https://github.com/user-attachments/assets/a2bd31d6-f093-48d1-bcb2-e249179ccb3b
Open in Web Open in Cursor 

@cursor cursor Bot changed the title Show blue contraflow arrow for bicycle:oneway=no on one-way ways Show blue contraflow arrow for oneway:bicycle=no on one-way ways May 30, 2026
@tordans tordans force-pushed the cursor/bicycle-oneway-reverse-arrow-2126 branch from cf48c0d to 90b8dd5 Compare May 31, 2026 04:50
When a way is one-way for motor traffic but tagged oneway:bicycle=no,
draw the existing black chevron for the general direction plus a second
blue chevron in the opposite direction, offset perpendicular to the way
so both arrows remain readable.

https: //wiki.openstreetmap.org/wiki/Key:oneway:bicycle

Increase gap between motor and bicycle chevrons to one icon width

Longitudinal offset is now 3× chevron length (motor body + gap + bicycle
tip placement) so < > pairs no longer overlap.

Co-Authored-By: Tobias <t@tobiasjordans.de>
@tordans tordans force-pushed the cursor/bicycle-oneway-reverse-arrow-2126 branch from a10938c to 839b341 Compare May 31, 2026 04:54
@tordans
Copy link
Copy Markdown
Owner Author

tordans commented May 31, 2026

Moved to bryceco#954

@tordans tordans closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants