Opened 3 years ago

Last modified 3 years ago

#22539 closed defect

Error in MAPCSS regarding LAYER and SET's ? — at Initial Version

Reported by: mikeho Owned by: team
Priority: normal Milestone:
Component: Core mappaint Version:
Keywords: Cc:

Description

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-*= "DE-ESO:hp0"::layer_signal_611,
node z17-*= "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-*= "DE-ESO:ks1"::layer_signal_612,
node z17-*= "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-*= "DE-ESO:ks2"::layer_signal_613,
node z17-*= "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*= "DE-ESO:hp0", node*= "DE-ESO:hp0" { set .sg_hp0; }

node*= "DE-ESO:ks1", node*= "DE-ESO:ks1" { set .sg_ks1; }

node*= "DE-ESO:ks2", node*= "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 https://josm.openstreetmap.de/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 (0)

Note: See TracTickets for help on using tickets.