[Potlatch-dev] Stylesheets (Potlatch 2/Halcyon)

Richard Fairhurst richard at systemed.net
Thu Jul 23 01:40:15 BST 2009


I spent an hour or two looking at the Flash Camouflage CSS parser (http://flashartofwar.com/2009/02/05/camo 
’s-css-parser/). It's pretty good, so the actual logistics of  
converting CSS to Halcyon's internal rendering engine aren't looking  
too hard.[1]

What I'm still unsure about is what the selectors should describe.

Option 1 is basically to write them as tests on OSM tags. So something  
like this:

	highway=primary,oneway=yes { color: red; }
	highway=motorway[z10-z15] { color: blue; width: 2px; }

Option 2 is to separate the OSM tag parser from the CSS style names.  
So you'd have:

	primary_oneway { color: red; }

and something somewhere else in the file would define that  
highway=primary,oneway=yes would use the primary_oneway style.

Option 2 is more 'pure CSS'-like but is another layer of abstraction  
for people to get their heads around.

I'm torn. Advice from wise folk would be welcome. :)

cheers
Richard

[1] In brief: each stylesheet has a list of rules. Each rule comprises  
the conditions (highway==primary, ref=~/^A/, that sort of thing); the  
zoom range (e.g. z13-z19); and references to the style that should be  
chosen. There's a few more refinements but that's basically it.




More information about the Potlatch-dev mailing list