Potlatch 2/Developer Documentation/Overview

From OpenStreetMap Wiki
Jump to navigation Jump to search

So you've checked out the Potlatch 2 source code with Git. Here's the most important stuff inside:

  • potlatch2
    • net/systemeD
      • controls
        Custom controls (auto complete, and the "floating alert" that gives feedback to users)
        halcyon
        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...)
        • connection
          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
            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".
          styleparser
          This is what parses MapCSS (and hence, potlatch2.css) into something Halcyon can render.
        potlatch2
        All the stuff that is specific to the Potlatch 2 editor, rather than the rendering of objects. In theory.
        • controller
          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.
          mapfeatures
          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.
          • editors
            The logic for editing each tag in the Simple view.
          tools
          Complex editing manipulations captured in toolbox buttons.
          Utils
          Esoteric interfaces with other data formats and other sites.
    resources
    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.