[Mapcss] Subpart syntax

Steve Bennett stevagewp at gmail.com
Thu Feb 24 00:38:22 GMT 2011

On Fri, Feb 4, 2011 at 5:46 AM, Sebastian Klein <bastikln at googlemail.com> wrote:
> Its a draft, so if you have suggestions / criticism, we should discuss it.
> Let me suggest to change the symbol from double colon to something
> unoccupied, e.g. a slash:
> way[access=private]::access  --->   way[access=private]/access
> The CSS spec has ::first_letter and ::before as examples for so called
> pseudo elements [1]. The first makes the rule apply only to the first letter
> and the latter inserts text like paragraph numbering into the document [2]

I just noticed this thread. First, can I check my understanding of the
goal here. MapCSS currently allows multiple things to be rendered for
a single rule, but only if they have distinct z-indexes. Any
information from a single rule for a given z-index is merged. So what
this aims to do is remove that limitation: multiple, independent
renderings of a single rule, possibly on the same z-index.

I'll also explicitly point out that the CSS spec you refer to is only
CSS3; CSS2 used a single colon for pseudo-classes (p:before {...}).

So, question: what would the name that you assign to a subpart be used
for? It doesn't seem that it would refer back to anything previously
defined. And if it itself is defining and identifying the subpart,
what would that identifier be useful for? If it is useful for nothing,
I would avoid requiring it to be named at all. Perhaps something like:


Or possibly ditch identifiers all together:

way[access=private] { /* definition 1 /* }
way[access=*] { /* more of definition 1 */ }

way[access=private] { new-subpart; /* definition 2 */ }
way[access=*] { /* continues definition 2 */ }

Another approach might be to use fractional z-indexes, where the
integer and fractional parts of a z-index can be specified

way[highway=residential] { z-index: 5; ... }
way[access=private] { z-index: .1; ... }
way[embankment=yes] { z-index: .2: ... }

So here, any way that is
highway=residential,access=private,embankment=yes, will have three
separate renderings, at levels 5.0, 5.1 and 5.2. A different kind of
highway might have them at 8.0, 8.1 and 8.2.

I think the subpart spec is going to have to make explicit what the
z-index ordering of the subparts is. And if they are implicitly all
within the range of a single z-index level, then it might make sense
to describe them as such. (Something like "z-index-fraction: 2" might
be clearer than the above.)

> What we have in mapcss is actually more clear cut: Create an extra
> world/layer/cascade for each subpart, the individual layers are independent
> from each other. In the end, render all of them at once (respecting
> z-index).
> This has not much to do with what CSS defines as pseudo element.

Yeah, there's no way in CSS to render the same element more than once,
which is actually a fairly big limitation.


More information about the Mapcss mailing list