[Mapcss] Mapcss clarifications

Komяpa me at komzpa.net
Mon Jul 5 12:44:45 BST 2010


2010/7/5 Sebastian Spaeth <Sebastian at sspaeth.de>:
> Before I start fudging the wiki, I'd like to have some clarifications on
> mapcss, which might or might not have been discussed.
>
> I take my infos from here: http://wiki.openstreetmap.org/wiki/MapCSS, right?
Well, no. We're editing actively
http://wiki.openstreetmap.org/wiki/MapCSS/0.2 which is supposed to be
changed (since 0.1 isn't clear at some points).



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


> 2) How are nodes supposed to be rendered?
>   - All the wiki page says about nodes/points, is "icon-image"
>    Would a "width" argument on a node render a circle, with a casing
>    argument render a border on that circle? Or are we restricted to
>    icon images here? We'll often want to use icons, but being able to
>    easily provide simple circle types with additional labeling would be
>    nice. I know, implementation details are left to the renderer, but
>    it would  be good to propose how those values could be used.
let me propose.

an "icon without icon" should probably be considered a horizontal line
of 0-length.
so,
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.

> 3) How is "fill-image" supposed to work on an area?
>    Scale image and fill it, clipping the borders? Repeat as pattern? We
>    probably want to borrow more CSS terms here to specify that
>    behavior, right?
Repeat as the pattern. I can't imagine any example when you need to
scale image and fill it.


> 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.

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
fill-color: eval(tag(name))

> 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.

-- 
Komяpa aka Darafei Praliaskouski
http://osm.komzpa.net xmpp:me at komzpa.net mailto:me at komzpa.net




More information about the Mapcss mailing list