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

Michal Migurski mike at stamen.com
Thu Jul 16 22:06:48 BST 2009


Hi Richard,

I think Cascadenik's strict adherence to CSS syntax might be sensible  
here - would it be worth our/my time doing some preliminary work on  
CSS-parsing in AS3? The lowest-level bits of Cacadenik are here:
	http://mapnik-utils.googlecode.com/svn/trunk/serverside/cascadenik/cascadenik/style.py

-mike.

On Jul 14, 2009, at 5:19 AM, Richard Fairhurst wrote:

> Hi all,
>
> Halcyon is the new WYSIWYG rendering engine for Potlatch 2. It draws
> ways and nodes according to rules in a stylesheet. You can see a demo
> at http://www.geowiki.com/halcyon/ .
>
> At present the stylesheet is a big YAML file, simply because it's very
> easy to parse. You can see one at
> http://svn.openstreetmap.org/applications/editors/potlatch2/ 
> test.yaml .
>
> But it's rather ugly, verbose, and not widely understood, so I'd like
> to move to something more CSS-like. Good work has already been done
> here by Cascadenik and Cartagen.
>
> My current thinking is that such a stylesheet might look roughly  
> like this:
>
>     // One simple rule
>     highway=primary {
>       color: red;
>       width: 5px;
>       border: 2px solid black;
>     }
>
>     // More complex rule
>     highway=trunk && oneway=yes {
>       color: green;
>       width: 4px;
>       border: 2px solid black;
>     }
>
>     // Two rules, same style for both
>     highway=unclassified, highway=tertiary {
>       color: yellow;
>       width: 4px;
>       border: 2px solid black;
>     }
>
>     // Specifying zoom level
>     [z13-15] highway=residential {
>       color: #777777;
>       width: 3px;
>       border: 1px solid black;
>     }
>
> In other words, the 'selector' is the tag rule. (There might be some
> special selectors, too: one for the background and one for a default
> style if nothing matches.)
>
> Does this make sense as a general approach?
>
> cheers
> Richard
>
>
> _______________________________________________
> Potlatch-dev mailing list
> Potlatch-dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/potlatch-dev
>

----------------------------------------------------------------
michal migurski- mike at stamen.com
                  415.558.1610







More information about the Potlatch-dev mailing list