1 == Halcyon and Potlatch 2.0 - ActionScript 3 renderer and editor ==
3 Potlatch 2.0 is the new version of the OpenStreetMap online editor.
5 Halcyon is its rendering engine. It's rules-based (like, say, Mapnik) and does dotted lines, text on a path, casing, icons for POIs, all of that.
7 Both are written in ActionScript 3. Potlatch 2.0 additionally uses the Flex framework.
9 === What you'll need ===
11 * Flex SDK 3.4 or 3.5 - http://www.adobe.com/products/flex/ (free, OS X/Windows/Linux)
12 * AS3 docs - http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
13 * Flash debug player - http://www.adobe.com/support/flashplayer/downloads.html
14 * Basically you might as well just sell your soul to Adobe
16 ***Do not use FlexSDK <= 3.3 or > 4***. There are compatibility errors with version 4, and 3.3
17 and earlier have this bug: http://bugs.adobe.com/jira/browse/SDK-16705 which is a major issue for the
20 You'll only need OSM Rails port installed on your local machine if you are doing hard-core
21 server-communication coding, but if generally you can use the dev server at api06.dev.openstreetmap.org
22 for development and testing.
25 === How to compile and run ===
29 The following command will compile potlatch2 in optimized configuration
30 The result is put at resources/potlatch2.swf
32 * mxmlc potlatch2.mxml
35 Compiling Halcyon as standalone viewer:
37 * mxmlc halcyon_viewer.as
40 Compiling during development:
42 Compiling optimized versions from scratch takes a _long_ time. There are
43 several ways to make it faster during development and also add useful
44 debug stack traces and enable the commandline debugger (at the expense
45 of a much larger swf file.. but we're developing so that doesn't matter!).
48 - launches the Flex Compiler SHell -- stops the compiler having to
49 bootstrap itself each time you invoke it. You don't /need/ this, but it
50 does make things slightly faster (about a second a shot for me)
52 * mxmlc -load-config+=debug-config.xml potlatch2.mxml
53 - compile potlatch2 in debug configuration -- build is incremental so you
54 can run it again and mxmlc will only compile changes. Output has debug
55 enabled along with decent stack traces.
56 (you can substitute halcyon_viewer.as in the above to compile that)
59 - when using fcsh recompile the first command
62 - type it again to compile again. You'll really wish that up-arrow,enter
63 worked, but Adobe is going laughing at you RIGHT NOW.
67 * Flash security model sucks. If you want to use internet resource (e.g. map calls to the dev
68 server) the binary must have been served from "teh internets". Run resources/server.rb to launch a local
69 server, then go to http://localhost:3333/potlatch2.html to get started (or if you're already running e.g.
70 Apache locally, feel free to use that instead.
72 * If you are doing offline development, you will need a rails_port install. You
73 will need to add an OAuth application by going to
74 http://rails-port.local/user/<username>/oauth_clients/new
75 Enter the following details (assuming the above point):
76 * Name (Required): Potlatch2 (local)
77 * Main Application URL (Required): http://localhost:3333/resources/potlatch2.html
78 And then update resources/potlatch2.html replacing the domains.
80 === Some other stuff you might need to know ===
82 * Flex compiler runs at about the speed of a tortoise soaked in molasses which happens also to be dead.
83 * Running the debug player helps when coding, since it'll pop up the runtime errors. You don't see them
84 with the normal player.