iD icon indicating copy to clipboard operation
iD copied to clipboard

Alternative map styles

Open quincylvania opened this issue 6 years ago • 12 comments

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.

quincylvania avatar Jul 03 '19 21:07 quincylvania

The toolbar might not be the best place for these to live, but for inspiration:

Screen Shot 2019-07-03 at 4 31 54 PM Screen Shot 2019-07-03 at 4 40 58 PM

quincylvania avatar Jul 03 '19 21:07 quincylvania

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

https://josm.openstreetmap.de/raw-attachment/wiki/Styles/addstyle.gif

matkoniecz avatar Jul 07 '19 08:07 matkoniecz

Looks like JSOM uses MapCSS. I wonder if iD should try to use that.

quincylvania avatar Jul 08 '19 17:07 quincylvania

Not sure how hard is to implement it, but making possible to use all styles made for JOSM sounds very nice.

matkoniecz avatar Jul 08 '19 19:07 matkoniecz

.... 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

sun-geo avatar Jul 16 '19 04:07 sun-geo

Many of the layers provided by the former ito! Map tool would be useful as lenses.

1ec5 avatar Jul 19 '19 20:07 1ec5

@quincylvania see https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation for the JOSM documentation. We use it both for styling and for validator rules.

don-vip avatar Jul 20 '19 21:07 don-vip

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.

mvexel avatar Aug 11 '19 17:08 mvexel

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.

quincylvania avatar Aug 12 '19 13:08 quincylvania

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.

1ec5 avatar Aug 19 '19 23:08 1ec5

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.

quincylvania avatar Feb 12 '20 01:02 quincylvania

For reference, Rapid implement things in this area:

  1. https://github.com/facebook/Rapid/pull/1230#issuecomment-1830149315 introduced Map Color Scheme and Colorblind mode
  2. https://github.com/facebook/Rapid/pull/1437 introduced a Heatmap overlay of Heatmap optimized data

tordans avatar May 22 '25 04:05 tordans