Opened 11 years ago
Closed 11 years ago
#9485 closed enhancement (fixed)
MapCSS: implement "set"
Reported by: | Don-vip | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.01 |
Component: | Core mappaint | Version: | |
Keywords: | mapcss grammar set | Cc: |
Description
From our very own implementation:
set
is not supported, instead ofway[highway=footway] { set path; color: #FF6644; width: 2; } way[highway=path] { set path; color: brown; width: 2; } way.path { text:auto; text-color: green; text-position: line; text-offset: 5; }
you can writeway[highway=footway] { path-set : true; color: #FF6644; width: 2; } way[highway=path] { path-set : true; color: brown; width: 2; } way[eval(prop(path-set))] { text:auto; text-color: green; text-position: line; text-offset: 5; }
I'd like to use this syntax in MapCSS-Tagchecker, we should support it.
Attachments (0)
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
As I understand the specification, it should allow us to define classes we can then use as selectors.
Examples I have in mind for #9379 and #9380:
way[highway=~/(motorway|trunk|primary|secondary|tertiary)(_link)?/] { set major_road; } way[highway=~/unclassified|residential|living_street|service/] { set minor_road; } way.major_road[motor_vehicle=yes] { throwWarning("unnecessary ..."); } way.major_road[foot=yes] { throwWarning("replace by sidewalk..."); }
comment:3 by , 11 years ago
Okay, thanks. I got the idea now.
I found an implementation in dart-mapcss
: https://github.com/Gubaer/dart-mapcss/blob/master/grammar/MapCSS.g#L413-L416 Here, only identifiers are allowed (no evaluation of complex expression is performed).
What should be the effect of a
set
statement?