Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pedestrian Focus Mode #1394

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

salvinax
Copy link

@salvinax salvinax commented May 1, 2024

The Pedestrian Focus Mode, accessible through the preferences panel, aims to reduce visual clutter and improve the clarity of pedestrian-friendly routes. This pull request builds upon PR #1230, which introduced a color scheme and colorblind mode system.

Changes:

  • Implemented logic to highlight pedestrian infrastructure
  • Ajusted rendering to grey out non-pedestrian elements
  • Added radio buttons to Preference panel to toggle between pedestrian/default mode
  • Added hotkey (Alt + P) that enables Pedestrian Focus mode

Notes:

  • Map elements tagged with foot=use_sidepath are considered as pedestrian infrastructure in this mode
  • Pedestrian Focus Mode is compatible with the existing color scheme and colorblind modes
  • There's not a lot of real estate when it comes to the keyboard shortcuts; Alt + P seems to work on most browsers on Windows

lauble and others added 6 commits April 30, 2024 19:52
Add default and example color scheme objects to colors.json.

Minify colors.json in build_data.js. Add colors.json to DataLoaderSystem's fileMap.

Add color scheme helper functions to StyleSytem, with comments to describe each functions parameters and return values (where applicable).

Update StyleSystem's styleMatch() function to interact with color scheme objects from colors.json rather than from STYLE_DECLARATIONS.

Fix white space discrepancies in StyleSystem.

Update color_selection.js and colorblind_mode_options.js to use StyleSystem rather than the non-existent ColorSystem.

Uncomment color schemes and colorblind mode options sections in preferences.js to add them to the Preferences pane of the UI.

Refs: Issue facebook#1230
@facebook-github-bot
Copy link

Hi @salvinax!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@tordans
Copy link

tordans commented May 1, 2024

I have been doing a lot of work on a very similar topic which is bike infrastructure. I am very happy to chat about what tagging issues we ran into when mapping bike/foot infrastructure on the centerline and as separate geometry.

For our mapping campaign https://wiki.openstreetmap.org/wiki/Brandenburg/Kampagne_Radnetz we used iD to help volunteers that don't know a lot about OSM or this kind of mapping to help add data. That is a great learning experience that I am happy to share.

A few quick notes

  • Some infrastructure is still a lot easier to map quickly on the centerline and for some regions (rural areas) that is also quite OK. But we need https://wiki.openstreetmap.org/wiki/Brandenburg/Kampagne_Radnetz to expose more centerline data and make it easier to map this in iD/Rapid. And also Support bicycle:side=value directional preset fields #1338.
  • Syncing the centerline and separate geometries is still way too hard. We focussed on the presence tagging of infrastructure (cycleway:left|right|both|null=separate, sidewalk:left|right|both|null=separate) but there are also the access tags (bicycle:left|right|both|null=use_sidepath|… and foot:left|right|both|null=use_sidepath|…)
  • There is no help, yet to find places where infrastructure was mapped twice, once on the centerline and once separate. Our https://radverkehrsatlas.de/ will show this for bike lanes in the given region, but explicit styles that show this right in the editor would be great
  • One piece of this puzzle is to handle separate infra vs. centerline is https://wiki.openstreetmap.org/wiki/Proposal:Key:is_sidepath. We recently sharpened the proposal and the tag helps us a lot when processing the data.


/**
* styleMatch
* @param {Object} tags - OSM tags to match to a display style
* @return {Object} Styling info for the given tags
*/
// eslint-disable-next-line complexity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't silence the warnings about code complexity.
I think these are useful.

@bhousel
Copy link
Contributor

bhousel commented May 1, 2024

This might conflict pretty hard against the work being done on #1384 - are you and @chinweibegbu working together on this?

@Bonkles
Copy link
Contributor

Bonkles commented May 1, 2024

This might conflict pretty hard against the work being done on #1384 - are you and @chinweibegbu working together on this?

Yes, they are! Both features would need some reconciliation/merging once they've collected feedback from us in both these PRs. I asked them to create draft branches to collect feedback via separate draft PRs, but the idea is they'd collapse together after that feedback.

@Bonkles
Copy link
Contributor

Bonkles commented May 2, 2024

Short video I captured of this feature in action in a busy intersection in amsterdam:

Screen.Recording.2024-05-02.at.5.07.21.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants