[Mapcss] Mapcss clarifications

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Jul 7 07:58:11 BST 2010


On 2010-07-05, Komяpa wrote:
> 2010/7/5 Sebastian Spaeth <Sebastian at sspaeth.de>:
> http://wiki.openstreetmap.org/wiki/MapCSS/0.2 which is supposed to be
> changed (since 0.1 isn't clear at some points).

OK, thanks.

> > 1) How are comments defined?
> /* */

That sounds good, I'll add that information to the wiki page.

> > 2) How are nodes supposed to be rendered?
> an "icon without icon" should probably be considered a horizontal line
> of 0-length.
> width - height of the object
> linecap controls caps, which are left and right parts of icon (i.e.
> "round" makes circle and "square" makes square).
> casing-linecap controls linecaps of casing around that.
> and all the other things probably should be taken from line properties.
> What should be considered is icon rotation, i.e. gates should be
> orthogonal to roads in some styles.

That makes sense to me. I'll have my renderer behave that way and use
the casing-* stuff for borders surrounding the circle/box. I have no
suggestion for the rotation yet, but that makes sense.
 
> > 3) How is "fill-image" supposed to work on an area?
> Repeat as the pattern. I can't imagine any example when you need to
> scale image and fill it.

Well, CSS offers the scaling or the don't repeat options, but for now I
also cannot think of cases where that is useful. So repeating in x and y
directions it is, I'll also note that down.

> > 4) How are color names defined? Is there a CSS set of color names/values
> >    that we can use, or do we have our own set? I snatched the color
> >    names from the python imaging library for now which provides 140
> >    names.
> I've taken webcolors image library with lots of colors and made cairo
> wrapper for that.

Mmmh, I need to look that up, I bet those colors are specified somewhere
beyond python source code :-).
 
> What I also propose is to define that any unknown string could be
> converted to color by taking first chars of its md5() as hex value of
> color. That would help coloring of administrative boundaries polygons in
> different colors by just writing

That sounds sensible (and I'll make it that way), but I would not make
that mandatory, the behavior in case of "invalid" colors might be left
to the renderer.

> > 8) Rules are supposed to be applied in file order? Or in other words, is
> >   this supposed to render my horsepaths blue?
> >      way [highway] {color:blue;}
> >      way .horsepath { set highway=unclassified;}
> No. The parser should go through sheet and apply things as it sees them.

OK, thanks that helped a lot already.

spaetz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/mapcss/attachments/20100707/553edd5e/attachment.pgp>


More information about the Mapcss mailing list