[Mapcss] Subpart syntax

Sebastian Klein bastikln at googlemail.com
Thu Feb 24 13:27:42 GMT 2011

Steve Bennett wrote:
> On Thu, Feb 24, 2011 at 10:23 PM, Sebastian Klein
> <bastikln at googlemail.com> wrote:
>> At the same time, it should be possible to _modify_ the rules from the base
>> style. (That's what the "cascading" css is all about, right.) E.g. in the
>> last example (more POI symbols) it doesn't make sense to have 2 symbols of
>> different size, overlapping each other. You either replace the symbol or
>> keep the old.
> Ah, ok. So the base style defines a certain look for, say
> "cycleway=lane", defining a "/lane" subpart, like:
> way[cycleway=lane]/bikelane { casing-color: blue; ... }
> A user could come along and say the bike lanes should be red...
> way/bikelane { casing-color: red; }
> That raises the question whether the syntax should distinguish between
> defining a subpart, and merely referring to one.
> Are there other use cases? It does still seem a bit of an uncommon case here.

I agree that it's rather uncommon to refer to a certain layer from 
another style sheet.

But it would be handy to refer to the same layer more than once within a 
certain style sheet. E.g. set the properties that are the same for all 
maxspeed restrictions. Then go on and be more specific:

way[maxspeed]::maxspeed_layer {
   width: +4;
   opacity: 0.2;
   z-index: -3;

way[maxspeed=30]::maxspeed_layer {
   color: lime;

way[maxspeed=50]::maxspeed_layer {
   color: blue;

This is an alternative approach to the "set" feature and imho more css-like.

In addition, it should be possible to apply properties to *all* layers.

Examples would be to improve readability by increasing the font size 
globally or manipulate all colours, e.g. to make it more suitable for 


More information about the Mapcss mailing list