Alternative map styles
The default map styling is fine for most users most of the time, but there are times when domain-specific styling could be useful. For example:
- Road
maxspeed(#5662) - Road
access(#2068) - Route membership (#659)
- Unnamed roads
- Unreviewed imports
We should build a general-purpose "lens" system that lets people quickly toggle between these styles ("lenses"). As part of #6483, lenses should be defined atomically and could be swapped in and out by downstream projects. Only some lenses would be suitable to ship with iD to everyone on osm.org, but ideally users could plug in their own lenses too.
I assume JOSM already has a feature like this. We should see how they do it.
The toolbar might not be the best place for these to live, but for inspiration:
I assume JOSM already has a feature like this. We should see how they do it.
It is called map paint styles in JOSM. See doc at https://josm.openstreetmap.de/wiki/Styles

Looks like JSOM uses MapCSS. I wonder if iD should try to use that.
Not sure how hard is to implement it, but making possible to use all styles made for JOSM sounds very nice.
.... For example:
- Road
maxspeed(#5662)- Road
access(#2068)- Route membership (#659)
- Unnamed roads
- Unreviewed imports
Sounds interesting, please add for me in the list
- Road
destination - Road
lanes - Road
turn:lanes
Many of the layers provided by the former ito! Map tool would be useful as lenses.
@quincylvania see https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation for the JOSM documentation. We use it both for styling and for validator rules.
I like how you can overlay multiple styles in JOSM -- they're additive. While this can get messy and produce unpredictable results, it does allow for more detailed tweaking. Not sure if this is something we'd want for iD, though.
I like how you can overlay multiple styles in JOSM -- they're additive. While this can get messy and produce unpredictable results, it does allow for more detailed tweaking. Not sure if this is something we'd want for iD, though.
While I can see how this might be useful sometimes, I'm not sure the added complexity is worth it. "Messy and unpredictable" goes against iD's goals. Perhaps there's an elegant way we could allow multiple complementary styles in the future, but I think one-at-a-time is sufficient as an initial implementation.
Unreviewed imports
Potlatch 2 has a “Highlight unedited TIGER (US roads)” option that still comes in handy in some parts of the U.S. Lenses like TIGER could be limited to certain regions (similar to imagery layers) or shareable somehow.
Since the change highlighting in #6843 came out pretty well, I'm thinking we might use the same outline mechanism for these other styles. The benefit is that we wouldn't lose the type information conveyed in the base rendering.
I'm inclined to forge ahead with a quick solution and not worry about MapCSS right now.
We'll also need a legend component somewhere to explain what the colors mean.
For reference, Rapid implement things in this area:
- https://github.com/facebook/Rapid/pull/1230#issuecomment-1830149315 introduced Map Color Scheme and Colorblind mode
- https://github.com/facebook/Rapid/pull/1437 introduced a Heatmap overlay of Heatmap optimized data