[Mapcss] relative width for overlays

Richard Fairhurst richard at systemeD.net
Sat Oct 2 19:41:02 BST 2010


Sebastian Klein wrote:
> I would like to create transparent overlay for bridges and tunnels that
> is 4 pixels wider than the main line style. How can this be done without
> repeating all highway types?

In Halcyon this is done by accessing a special '_width' variable, which 
has the width of the widest rendered stroke, so:

way :selected { z-index: 2; width: eval('_width+10'); color: yellow; 
opacity: 0.7;}

(see 
http://svn.openstreetmap.org/applications/editors/potlatch2/net/systemeD/halcyon/styleparser/StyleChooser.as 
and, in particular, tags['_width']=sl.maxwidth; r.runEvals(tags);)

As ever, very open to better ways of doing it. :)

cheers
Richard



More information about the Mapcss mailing list