Potlatch 2/Developer Documentation/Overview
From OpenStreetMap Wiki
So you've checked out the Potlatch 2 source code with Git. Here's the most important stuff inside:
- Custom controls (auto complete, and the "floating alert" that gives feedback to users)
- Halcyon is the rendering engine. In here is all the stuff about the map data itself, rendering it, and manipulating it. Notable classes in this folder are Map (concerned with the visible portion of the map), MapPaint (display it), the EntityUI classes (which deal with the user-interactive, visible representation of map objects), TileSet (background layers), and VectorLayer (GPX layers, bugs layers...)
- The various map entities (Node, Way, Tag, Relation, Changeset...) are all defined here, with some support classes. The "Connection" itself holds all currently downloaded data (up to around 1000 objects, give or take - objects that are off screen and not modified get purged).
- Actions manipulate map objects in pre-defined ways, so the undo system can undo and redo them. You don't just move a node around, you use a "MoveNodeAction".
- This is what parses MapCSS (and hence, potlatch2.css) into something Halcyon can render.
- All the stuff that is specific to the Potlatch 2 editor, rather than the rendering of objects. In theory.
- Controller states capture the interaction between the mouse/keyboard and the map. They define all the rules like what happens if you click on a node while drawing a way.
- The logic for "map features" - the pre-defined combinations of tags that make a road a road, a bakery a bakery etc. That includes parsing map_features.xml, and also recognising objects.
- The logic for editing each tag in the Simple view.
- Complex editing manipulations captured in toolbox buttons.
- Esoteric interfaces with other data formats and other sites.
- All the icons, map_features.xml (and subordinate files), help files, MapCSS files etc. Basically, anything that isn't needed at compile time, but which will be downloaded from the server as needed.