Technical Guide
Plugin architecture
Code organization:
js/extension/components: React UI (no direct I/O).js/extension/stateManagement: actions, reducer, selectors, epics.js/extension/requests: I/O calls (WFS, area of competence).js/extension/utiles: pure helpers (permissions, attributes, auto fields, i18n, geometry).js/extension/plugin: MapStore wiring (createPlugin, reducers, epics).
Expected Redux flow:
- Component dispatches an action.
- Epic intercepts and calls
requests. - Success/error dispatches Redux actions.
- Selectors feed the UI.
Local install
Prerequisites:
- Node.js and npm
- repository cloned with MapStore2 submodule
Commands:
npm install
npm start
Application runs on http://localhost:8081.
Build extension
npm run ext:build
The extension zip is generated in dist/.
Configuration notes
- Plugin is declared in
assets/index.jsonwith namepanel_editor. - Extension name is defined in
config.js. - Runtime configuration is in
configs/localConfig.json. - Automatic fields (
auto) are resolved in helpers, then injected into the transaction at save time. - Supported
autotypes includeheader,date,area,length, andvalue. Default units arem²forareaandmforlength. listfields support a static array, a remote JSON source{ url, field }, or an empty array to infer values from already loaded features.- Field visibility differs between read and edit modes:
hiddenalways hides in read mode, while ahiddenfield can be shown in edit mode when configured infields. - Layer permissions support
allowEdit,allowEditRoles, then the legacy fallbackedit/editingRoles. restrictedAreacan rely either on awktor on a JSONurl. There is no built-in default endpoint.wktis interpreted asEPSG:4326, then reprojected to the Identify features CRS beforeWITHIN/INTERSECTS/CONTAINSchecks.restrictedAreais evaluated before entering edit mode and, combined with role checks, drives UI state (lock,record, or both).- In edit mode, layer and feature selectors are disabled to prevent context changes before save or cancel.
- Delete button behavior uses two checks: visibility through
allowDelete, then enabled state throughdelete/deletionRolespermissions. - The
requestslayer also validates WFS-T XML responses: an HTTP200containing an OGC/WFS error is treated as an application error.
Additional reference
For more details about MapStore extension patterns and plugin development, see the official repository: