[josm-dev] MapCSS

André Riedel riedel.andre at gmail.com
Tue Mar 1 20:23:02 GMT 2011


Hello,

first of all thank you for your great mapcss and style-selector integration.
While testing it, some questions came up.

1. Are relative width values only be supported by JOSM or is it a main
feature of MapCSS 0.1 or 0.2?

2. See my test case:
css-file, test.osm, rendering.png: (26,2 kb) http://www.loaditup.de/590511.html

way[highway] { color: yellow; width: 7; }
way[highway=motorway] { color: blue; width: 10;}
/* trunk should be rendered 2px wider than a general highway */
way[highway=trunk] { color: green; width: +2;}
/* bridges should be rendered 5px wider than the based highway */
way[highway][bridge][bridge!=no]::bridge_layer { z-index: -1; color:
grey; width: +5;}
/* a big bridge should be rendered 2px wider than a general bridge */
way[highway][bridge=big_bridge]::bridge_layer { width: +2;}
/* service should be rendered 2px narrower than a general highway */
way[highway=service] { color: orange; width: -2;}
/* a 2px smaller line above the based highway */
way[highway][small=yes]::small_layer { z-index: 1; color: grey; width: -2;}

My results with this little test:
- JOSM supports absolute values with no problems
- relative values only be supported for a separate layer
- no support for negative relative values
- no support for cascading relative values (see big_bridge)

3. Why are there different definitions of casing-width?

JOSMCSS [1]:
 absolute value -> absolute width of the casing
 relative value -> refers to width
MapCSS 0.1 [2]:
 -> absoulte width
MapCSS 0.2 [3]:
 -> relative width

example: line width 7px and overall width of the casing 9px
values for casing-width:
JOSMCSS absolute -> 9
JOSMCSS relative -> +2
MapCSS 0.1 -> 9
MapCSS 0.2 -> 1

[1] http://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation
[2] http://wiki.openstreetmap.org/wiki/MapCSS
[3] http://wiki.openstreetmap.org/wiki/MapCSS/0.2

Ciao André



More information about the josm-dev mailing list