[Mapcss] multi-strokes and subparts
Sebastian Spaeth
spaetz at sspaeth.de
Wed Jul 14 10:21:26 BST 2010
On Tue, 13 Jul 2010 23:09:53 +0200, Sebastian Klein <bastikln at googlemail.com> wrote:
> E.g. you have a large and nice standard style file. But then you simply
> want to show motorways on half transparent map:
>
> [...] standard styles [...]
> node::*, way::*, relation::* { opacity: eval(0.1 * prop(opacity)); }
> way[highway=motorway] { opacity: 1; width: eval(1.4 * prop(width));
> z-index: 100; }
> (The example is a little artificial, but maybe you get the idea.)
Yes, I agree that ::* should probably be able to override
things. However in your example you say:
way::* { a; }
way::A { b; }
is equivalent to way::A {a;b;}.
So ::* works even on subparts that are not yet specified in the style
sheet? Or would it only apply to subparts that have been created before?
As in:
way::A { b; }
way::* { a; }
way::B { c; }
===>way::A { a; b;}
way::B { c;}
> I implemented it a little different. The approach is described on the wiki:
> http://wiki.openstreetmap.org/wiki/Talk:MapCSS/0.2
I agree with your approach of having ::* override stuff, but I don't get
this:
> way[highway=footway] { width: 2; z-index: 3; }
> way[fixme]::fixme_highlight { width: 10; z-index: 2; color: red; text: "fixme"; font-size: 12; }
> draws footways with width 2 and highlights all ways if they have the
> FIXME key.
So this draws 2 things? How do you specify generic styles that can be
overridden in specific subparts? With ::* rules at the beginning of a file?
> way[highway=footway] { width: 2; z-index: 3; }
> way[fixme]::fixme_highlight { width: 10; ...text: "fixme";}
> Otherwise [::default] is just an ordinary subpart.
This way
way[highway=footway]
is NOT a superset of
way[highway=footway]::centerline
which is what I argued for earlier. I do believe that the relationship
between "way" and "way::centerline" should be the same as for "way" and
"way[highway]".
Sebastian
More information about the Mapcss
mailing list