[Mapcss] eval and set

Sebastian Spaeth spaetz at sspaeth.de
Thu Jul 15 10:40:10 BST 2010


On Thu, 15 Jul 2010 01:58:46 +0300, Komяpa <me at komzpa.net> wrote:

> In kothic, I do a render pass for every layer=. So, for good-looking
> bridges you need to just set layer=1 in osm data ;)

Right. But in order to get primary roads on top of tertiary roads I
define:
way[highway=primary] {z-index: 0.2;}
way[highway=secondary] {z-index: 0.1;}

which works great as in I don't need to hardcode any knowledge about
road types in the parser as everything is specified in the mapcss.
But that doesn't let me add layer values... mmh, or now that I come to
think about it:
    way[highway=primary] {z-index: eval(tag(layer)+0.2);}
should do just fine. What do you think? I think, I'll make it work that way
for now.

> eval() synthax is described in
> http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval
> those examples are left from mapcss0.1.

Thanks, I should have looked that up before :-(.

Sebastian




More information about the Mapcss mailing list