# origo-map/origo architecture

> Architecture diagram of the GitHub repository origo-map/origo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/origo-map/origo
- Repository: https://github.com/origo-map/origo

## Overview

Origo is a configurable OpenLayers-based web mapping framework: an application user opens a map, inspects and navigates its layers, and can use optional tools to edit, draw, share, print, import, or work offline. The graph preserves those documented and tree-evident capabilities while avoiding claims about unsampled wiring. Sampled code confirms offline download/sync dispatch, editor transaction selection, drawing interactions, and attachment-service requests; other connections are limited to clear runtime responsibilities.

Main entry points: [`src/controls/offline/downloadhandler.js`](https://github.com/origo-map/origo/blob/master/src/controls/offline/downloadhandler.js) (Offline downloads), [`src/viewer.js`](https://github.com/origo-map/origo/blob/master/src/viewer.js) (Viewer runtime), [`src/controls/editor/transactionhandler.js`](https://github.com/origo-map/origo/blob/master/src/controls/editor/transactionhandler.js) (Edit transactions), [`src/layer`](https://github.com/origo-map/origo/tree/master/src/layer) (Layer sources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_map["Map application"]
  node_viewer["Viewer runtime<br/>[viewer.js]"]
  node_map["Map engine<br/>[map.js]"]
  node_ui["Application UI<br/>[ui.js]"]
  node_controls["Control registry<br/>[controls.js]"]
end

subgraph group_data["Map data"]
  node_layers["Layer creation<br/>[layer.js]"]
  node_layer_types["Layer sources"]
end

subgraph group_explore["Map exploration"]
  node_legend["Layer legend<br/>[legend.js]"]
  node_search["Map search<br/>[search.js]"]
  node_selection["Feature selection"]
  node_feature_info["Feature information<br/>[featureinfo.js]"]
  node_navigation["Map navigation<br/>[zoom.js]"]
end

subgraph group_author["Authoring and editing"]
  node_editor["Feature editor"]
  node_transactions["Edit transactions"]
  node_wfs_transaction["WFS transaction<br/>[wfstransaction.js]"]
  node_ags_transaction["AGS transaction<br/>[agstransaction.js]"]
  node_draw["Drawing tools<br/>[drawhandler.js]"]
  node_attachments["Attachments"]
end

subgraph group_extras["Optional capabilities"]
  node_offline["Offline downloads<br/>[downloadhandler.js]"]
  node_offline_store[("Offline edit store<br/>[offlinestore.js]")]
  node_offline_sources["Offline sources"]
  node_sharing["Map sharing<br/>[sharemap.js]"]
  node_printing["Map printing"]
  node_import["File import<br/>[draganddrop.js]"]
  node_export["Feature export"]
end

node_user(("Map user"))
node_service(("Map services"))
node_browser[("Browser storage")]
node_attachment_service(("Attachment service"))

node_user -->|"opens map"| node_viewer
node_viewer -->|"creates map"| node_map
node_viewer -->|"registers controls"| node_controls
node_viewer -->|"builds interface"| node_ui
node_map -->|"uses layers"| node_layers
node_layers -->|"creates sources"| node_layer_types
node_layer_types -->|"requests map data"| node_service
node_user -->|"manages layers"| node_legend
node_user -->|"searches map"| node_search
node_user -->|"navigates map"| node_navigation
node_user -->|"selects features"| node_selection
node_selection -->|"shows details"| node_feature_info
node_user -->|"edits features"| node_editor
node_editor -->|"submits edits"| node_transactions
node_transactions -->|"dispatches WFS"| node_wfs_transaction
node_transactions -->|"dispatches AGS"| node_ags_transaction
node_user -->|"draws features"| node_draw
node_user -->|"manages attachments"| node_attachments
node_attachments -->|"fetches and posts"| node_attachment_service
node_user -->|"requests offline data"| node_offline
node_offline -->|"requests source data"| node_offline_sources
node_offline -->|"reads and writes edits"| node_offline_store
node_offline -->|"restores online source"| node_layer_types
node_offline -->|"persists offline state"| node_browser
node_user -->|"shares map"| node_sharing
node_user -->|"prints map"| node_printing
node_user -->|"imports files"| node_import
node_user -->|"exports features"| node_export

click node_viewer "https://github.com/origo-map/origo/blob/master/src/viewer.js"
click node_map "https://github.com/origo-map/origo/blob/master/src/map.js"
click node_ui "https://github.com/origo-map/origo/blob/master/src/ui.js"
click node_controls "https://github.com/origo-map/origo/blob/master/src/controls.js"
click node_layers "https://github.com/origo-map/origo/blob/master/src/layer.js"
click node_layer_types "https://github.com/origo-map/origo/tree/master/src/layer"
click node_legend "https://github.com/origo-map/origo/blob/master/src/controls/legend.js"
click node_search "https://github.com/origo-map/origo/blob/master/src/controls/search.js"
click node_selection "https://github.com/origo-map/origo/blob/master/src/selectionmanager.js"
click node_feature_info "https://github.com/origo-map/origo/blob/master/src/featureinfo.js"
click node_navigation "https://github.com/origo-map/origo/blob/master/src/controls/zoom.js"
click node_editor "https://github.com/origo-map/origo/tree/master/src/controls/editor"
click node_transactions "https://github.com/origo-map/origo/blob/master/src/controls/editor/transactionhandler.js"
click node_wfs_transaction "https://github.com/origo-map/origo/blob/master/src/controls/editor/wfstransaction.js"
click node_ags_transaction "https://github.com/origo-map/origo/blob/master/src/controls/editor/agstransaction.js"
click node_draw "https://github.com/origo-map/origo/blob/master/src/controls/draw/drawhandler.js"
click node_attachments "https://github.com/origo-map/origo/blob/master/src/utils/attachmentclient.js"
click node_offline "https://github.com/origo-map/origo/blob/master/src/controls/offline/downloadhandler.js"
click node_offline_store "https://github.com/origo-map/origo/blob/master/src/controls/offline/offlinestore.js"
click node_offline_sources "https://github.com/origo-map/origo/tree/master/src/controls/offline"
click node_sharing "https://github.com/origo-map/origo/blob/master/src/controls/sharemap.js"
click node_printing "https://github.com/origo-map/origo/tree/master/src/controls/print"
click node_import "https://github.com/origo-map/origo/blob/master/src/controls/draganddrop.js"
click node_export "https://github.com/origo-map/origo/blob/master/src/infowindow_exporthandler.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_viewer,node_map,node_ui,node_controls,node_user toneBlue
class node_layers,node_layer_types,node_browser toneAmber
class node_legend,node_search,node_selection,node_feature_info,node_navigation toneMint
class node_editor,node_transactions,node_wfs_transaction,node_ags_transaction,node_draw,node_attachments toneRose
class node_offline,node_offline_store,node_offline_sources,node_sharing,node_printing,node_import,node_export,node_service,node_attachment_service toneIndigo
```

## Components

### Map application

- [Viewer runtime](https://github.com/origo-map/origo/blob/master/src/viewer.js): `src/viewer.js`
- [Map engine](https://github.com/origo-map/origo/blob/master/src/map.js): `src/map.js`
- [Application UI](https://github.com/origo-map/origo/blob/master/src/ui.js): `src/ui.js`
- [Control registry](https://github.com/origo-map/origo/blob/master/src/controls.js): `src/controls.js`

### Map data

- [Layer creation](https://github.com/origo-map/origo/blob/master/src/layer.js): `src/layer.js`
- [Layer sources](https://github.com/origo-map/origo/tree/master/src/layer): `src/layer`

### Map exploration

- [Layer legend](https://github.com/origo-map/origo/blob/master/src/controls/legend.js): `src/controls/legend.js`
- [Map search](https://github.com/origo-map/origo/blob/master/src/controls/search.js): `src/controls/search.js`
- [Feature selection](https://github.com/origo-map/origo/blob/master/src/selectionmanager.js): `src/selectionmanager.js`
- [Feature information](https://github.com/origo-map/origo/blob/master/src/featureinfo.js): `src/featureinfo.js`
- [Map navigation](https://github.com/origo-map/origo/blob/master/src/controls/zoom.js): `src/controls/zoom.js`

### Authoring and editing

- [Feature editor](https://github.com/origo-map/origo/tree/master/src/controls/editor): `src/controls/editor`
- [Edit transactions](https://github.com/origo-map/origo/blob/master/src/controls/editor/transactionhandler.js): `src/controls/editor/transactionhandler.js`
- [WFS transaction](https://github.com/origo-map/origo/blob/master/src/controls/editor/wfstransaction.js): `src/controls/editor/wfstransaction.js`
- [AGS transaction](https://github.com/origo-map/origo/blob/master/src/controls/editor/agstransaction.js): `src/controls/editor/agstransaction.js`
- [Drawing tools](https://github.com/origo-map/origo/blob/master/src/controls/draw/drawhandler.js): `src/controls/draw/drawhandler.js`
- [Attachments](https://github.com/origo-map/origo/blob/master/src/utils/attachmentclient.js): `src/utils/attachmentclient.js`

### Optional capabilities

- [Offline downloads](https://github.com/origo-map/origo/blob/master/src/controls/offline/downloadhandler.js): `src/controls/offline/downloadhandler.js`
- [Offline edit store](https://github.com/origo-map/origo/blob/master/src/controls/offline/offlinestore.js): `src/controls/offline/offlinestore.js`
- [Offline sources](https://github.com/origo-map/origo/tree/master/src/controls/offline): `src/controls/offline`
- [Map sharing](https://github.com/origo-map/origo/blob/master/src/controls/sharemap.js): `src/controls/sharemap.js`
- [Map printing](https://github.com/origo-map/origo/tree/master/src/controls/print): `src/controls/print`
- [File import](https://github.com/origo-map/origo/blob/master/src/controls/draganddrop.js): `src/controls/draganddrop.js`
- [Feature export](https://github.com/origo-map/origo/blob/master/src/infowindow_exporthandler.js): `src/infowindow_exporthandler.js`

### Other components

- **Map user**
- **Map services**
- **Browser storage**
- **Attachment service**

## Connections

- Map user → Viewer runtime: opens map
- Viewer runtime → Map engine: creates map
- Viewer runtime → Control registry: registers controls
- Viewer runtime → Application UI: builds interface
- Map engine → Layer creation: uses layers
- Layer creation → Layer sources: creates sources
- Layer sources → Map services: requests map data
- Map user → Layer legend: manages layers
- Map user → Map search: searches map
- Map user → Map navigation: navigates map
- Map user → Feature selection: selects features
- Feature selection → Feature information: shows details
- Map user → Feature editor: edits features
- Feature editor → Edit transactions: submits edits
- Edit transactions → WFS transaction: dispatches WFS
- Edit transactions → AGS transaction: dispatches AGS
- Map user → Drawing tools: draws features
- Map user → Attachments: manages attachments
- Attachments → Attachment service: fetches and posts
- Map user → Offline downloads: requests offline data
- Offline downloads → Offline sources: requests source data
- Offline downloads → Offline edit store: reads and writes edits
- Offline downloads → Layer sources: restores online source
- Offline downloads → Browser storage: persists offline state
- Map user → Map sharing: shares map
- Map user → Map printing: prints map
- Map user → File import: imports files
- Map user → Feature export: exports features
