Hi.
I'm not developing mapcss-related stuff yet, but perhaps I can propose a solution for the question discussed here.

Perhaps you could include a kind of standard value, cascaded as every other value. The default value could be set for the overall map object. I'll call it #map for now. With this it could be possible to set all line widths (or other measurements perhaps as well) to a base value:

#map {
  base-stroke-width: 5;
}

If no other value for stroke-width is specified, this base value is used for the real stroke width of this object.

To use relative values for another css rule, we now can use

.residential
{
  relative-stroke-width: 2;
}

.footway
{
  relative-stroke-width: -2;
}

Of course implementations have to deal with styles interfering with each other, e.g.

.cycleway
{
  relative-stroke-width: -2;
  stroke-width:5;
}

but I think, that's a part of CSS and should be handled in other cases as well, taking the last defined value or anything like that.

regards
Peter Wendorff

On 03.10.2010 16:49, Komяpa wrote:
Thanks for you answers! Because it is so common, I was tempted to use a
shortcut:

    width: +4;
I was going to suggest the same thing. I think the notion of "define
this width relative to another width" is so common, it's worth having
notation for it.
This syntax should be thought more to be pushed into more-or-less
standard mapcss.

1) it becomes a lot harder to parse. +1 and 1 are considered the same
in most programming languages, so you can't just linearly transform
mapcss into (for example) JSON form, also can't even hold in a single
variable.

2) what should be used for a base for adding and substracting widths?

3) Most of those use-cases are well-covered (IMHO) with casing thing.





_______________________________________________
Mapcss mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/mapcss

Reply via email to