#22539 closed defect (worksforme)
Error in MAPCSS regarding LAYER and SET's ? — at Version 1
| Reported by: | mikeho | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core mappaint | Version: | |
| Keywords: | Cc: |
Description (last modified by )
I am in the process of building some useful mapcss for JOSM. Concerning the turnouts this works, in that I have stored a corresponding graphic for each configuration.
Regarding the signals I had the idea to build the possible signal states on the fly from a few graphics (e.g. black background in front of green / red / yellow dot for ks1 / hp0 / ...).
The following works:
node z17-["railway:signal:combined:states" *= "DE-ESO:hp0"]::layer_signal_611, node z17-["railway:signal:main:states" *= "DE-ESO:hp0"]::layer_signal_611 { z-index: 611; icon-image: "icons/light_rr.png"; icon-offset-x: 0; icon-offset-y: -20; allow-overlap: true; } node z17-["railway:signal:combined:states" *= "DE-ESO:ks1"]::layer_signal_612, node z17-["railway:signal:main:states" *= "DE-ESO:ks1"]::layer_signal_612 { z-index: 612; icon-image: "icons/light_gr.png"; icon-offset-x: -5; icon-offset-y: -10; allow-overlap: true; } node z17-["railway:signal:combined:states" *= "DE-ESO:ks2"]::layer_signal_613, node z17-["railway:signal:main:states" *= "DE-ESO:ks2"]::layer_signal_613 { z-index: 613; icon-image: "icons/light_or.png"; icon-offset-x: 5; icon-offset-y: -10; allow-overlap: true; }
My idea to first remember the states via Set (classes) does not work regarding the display in connection with the layers (without ::layer___ it works))
1) get status
node["railway:signal:combined:states" *= "DE-ESO:hp0"], node["railway:signal:main:states" *= "DE-ESO:hp0"] { set .sg_hp0; } node["railway:signal:combined:states" *= "DE-ESO:ks1"], node["railway:signal:main:states" *= "DE-ESO:ks1"] { set .sg_ks1; } node["railway:signal:combined:states" *= "DE-ESO:ks2"], node["railway:signal:main:states" *= "DE-ESO:ks2"] { set .sg_ks2; }
2) display
node.sg_hp0::layer_signal_611 { z-index: 611; icon-image: "icons/light_rr.png"; icon-offset-x: 0; icon-offset-y: -20; allow-overlap: true; } node.sg_ks1::layer_signal_612 { z-index: 612; icon-image: "icons/light_gr.png"; icon-offset-x: -5; icon-offset-y: -10; allow-overlap: true; } node.sg_ks2::layer_signal_613 { z-index: 613; icon-image: "icons/light_or.png"; icon-offset-x: 5; icon-offset-y: -10; allow-overlap: true; }
Unfortunately I didn't find anything useful at wiki:Help/Styles/MapCSSImplementation. Can't JOSM do the combo of layer and sets or am I thinking wrong?
Many greetings
mikeho
Translated with www.DeepL.com/Translator (free version)
Change History (1)
comment:1 by , 3 years ago
| Cc: | removed |
|---|---|
| Component: | Core → Core mappaint |
| Description: | modified (diff) |
| Resolution: | → worksforme |
| Status: | new → closed |



A couple of notes:
cc-- the reporter will get replies sent to them.{{{#!mapcss}}}. Example:{{{#!mapcss [mapcss here] }}}.pngto theicon-imagepaths -- JOSM will automatically try.pngand.svg.setoperation in (1) on the "default" layer. So you want to use prop(p_name, layer_name) or the equivalent foris_prop_setin (2), depending upon what you are trying to do. Example: