[Potlatch-dev] Halcyon and MapCSS - first version

Richard Fairhurst richard at systemeD.net
Fri Sep 4 17:49:28 BST 2009


I've committed a first version of Halcyon, the AS3 renderer, with a  
CSS parser.

Here's a few of the things it does:

- z-index within OSM layers, so you can have multiple strokes for each object

- proper enclosing objects, so you can write:
       relation [network=ncn] way { z-index: 2; color: blue; width: 10; }
   and get a nice blue highlight for ways on an NCN route

- simulated classes via assigning tags on the fly:
       way[highway=trunk] { set .bigroad; }
       way[highway=primary][ref=~/^A/] { set .bigroad; }
       .bigroad { color: red; width: 12; casing-width: 14; }

- pseudo-selectors for :hover and :selected within the Potlatch 2  
editing environment (genius idea thanks to Dave)

- bitmap fills (ooh, shiny)

- lots lots more

There's also plenty I've not had chance to do yet: CSS support for  
dotted/dashed lines (the drawing code's in there, though), rendering  
nodes-within-ways, @import rules, and so on. And there's some scary  
stuff (e.g. shields) I'm leaving to another day.

But it's all good fun. I'll put up a type-your-own-CSS-and-refresh  
demo next week, hopefully. If you want to play with it before then:

1. check out http://svn.openstreetmap.org/applications/editors/potlatch2/
2. build with mxmlc -output=/path/to/halcyon_viewer.swf halcyon_viewer.as
3. copy all the stuff from resources/ to your local webserver
4. open 127.0.0.1/path/to/halcyon.html

Brief language notes at http://wiki.openstreetmap.org/wiki/MapCSS .

cheers
Richard





More information about the Potlatch-dev mailing list