[Mapcss] another css-for-maps implementation

Komяpa me at komzpa.net
Wed Sep 29 08:36:00 BST 2010


Hi,
nice to see you here too :)

2010/9/29 David Winslow <cdwinslow at gmail.com>:

> From a brief perusal of the documentation on the OSM wiki, I see the
> following major differences between my take on CSS-for-maps and MapCSS:
> square brackets for expressions vs. eval('')

Well, I'd want to explain my vision of why it's called eval() and
better to be so.
There are renderers in different languages, including Python,
ActionScript, tcl, JS and so on. Hard for me to imagine something that
will execute at roughly the same speed as native eval() in those
environments. That's why MapCSS eval (
http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval ) syntax was
designed in a way that those languages can just take as-is and
execute, providing a faster development and nice features on the cost
of some "security issues". At least for Python there are "restricted
eval" implementations that can't do anything except for what author
allowed.

MapCSS is not the only who does that; http://cartagen.org/ has the
same idea in their maps language.

In case someone cares a lot of security, he is free to reimplement a
runtime for eval() expressions that won't do any harm for sure.

> repeated properties (inspired by CSS3;
> see http://www.w3.org/TR/css3-background/#layering) vs. repeated property
> lists.

Nice idea. Things that stop from taking it as-is is that
1) we've got comma-separated lists for dashes - how to stack them?
2) cascading becomes somewhat undefined. i.e.:
.... {linecap:butt,round; width: 2,3}
 .... {width:2 }
what color and how many lines will we get if both are applied?

> the concept of "well-known marks" (cribbed from GeoServer's native styling
> language, SLD, see
> http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/points.html#simple-point),
> basically built-in simple geometries which have their own styling attributes
Nice. For now we've got only square and circle for nodes, emulated as
if it was a zero-length horizontal line (just two linecaps near one
another).

But, seems to me that this idea (to extend that list) is probably not
for 0.2 mapcss - 'til now it was more-or-less happily done with
images. We still don't have a reference renderer that supports 100% of
mapcss 0.2, though Kothic is near to that :)

-- 
Darafei "Komяpa" Praliaskouski
OSMF BY Team
xmpp:me at komzpa.net mailto:me at komzpa.net



More information about the Mapcss mailing list