PHPackages                             mapbender/digitizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mapbender/digitizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mapbender/digitizer
===================

Mapbender digitizer element

2.0.9(1mo ago)519.9k↓35.1%9[4 issues](https://github.com/mapbender/mapbender-digitizer/issues)[4 PRs](https://github.com/mapbender/mapbender-digitizer/pulls)1MITJavaScriptPHP &gt;=8.1

Since Jun 27Pushed 2w ago16 watchersCompare

[ Source](https://github.com/mapbender/mapbender-digitizer)[ Packagist](https://packagist.org/packages/mapbender/digitizer)[ RSS](/packages/mapbender-digitizer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (222)Used By (1)

Mapbender Digitizer element
===========================

[](#mapbender-digitizer-element)

⚠️ This version is compatible with Mapbender 4 only. The latest digitizer release compatible with Mapbender 3 is [1.5.7](https://github.com/mapbender/mapbender-digitizer/releases/tag/1.5.7)

---

Display and edit features (and feature attributes) stored in database tables in a Mapbender application.

Feature listings are displayed as (HTML) tables. Geometries can be created or edited using a predefined set of tools, and their attributes can be in customizable forms.

Designed for use in a sidepane.

Data is organized into "schemes" to support integration of multiple database tables.

If multiple schemes are defined, Digitizer will display a dropdown to allow schema switching.

Each schema separately defines tool availability, how data is listed, and the structure of the form used for editing attributes.

Connects to PostgreSQL Postgis or Oracle spatial database tables. Please refer to [the Data Source documentation](https://github.com/mapbender/data-source#configuring-repositories)for details.

Connection and table configuration may either be inlined into the schema configuration directly, or reference an existing global configuration placed into a Symfony container parameter.

Digitizer does not support tables without geometry columns.

After installation
------------------

[](#after-installation)

Using Digitizer requires registering *two* bundles in your application kernel. Register *both*`\Mapbender\DataManagerBundle\MapbenderDataManagerBundle` and `\Mapbender\DigitizerBundle\MapbenderDigitizerBundle`.

Configuring feature interactions
--------------------------------

[](#configuring-feature-interactions)

Each schema may define the following values to control access to data modifying interactions:

nametypedescriptiondefaultallowCreateboolean or list of stringsAllow user to make new featurestrueallowEditboolean or list of stringsAllow user to modify existing feature attributestrueallowDeleteboolean or list of stringsAllow user to remove features from the databasetrueallowDigitizeboolean or list of stringsAllow geometry editing (attribute editing must also be allowed via `allowEdit`)trueroleslist of strings or nullShow this schema only to users with (at least one of) these rolesnullThe `roles` list should contain entries understood by the Symfony grants system, such as `ROLE_USER` for logged-in users or `ROLE_GROUP_SOMETHING` for a user group created and assigned in the Mapbender administration backend.

The allow... settings named above may also contain lists of role names to limit modification to certain groups of users. If they are booleans, access is uniform for all users (including anyonymous users).

User specific data
------------------

[](#user-specific-data)

Data shown in each schema can be separate for different users. Each schema may define:

nametypedescriptiondefaultfilterUserbooleanKeep data separate for each userfalsetrackUserbooleanStore the creating / modiying user (can be done without actually filtering selection)falseSetting either of these to true additionally requires a `userColumn` (string) to be defined in the dataStore / featureType definition. This must name a database column of sufficient length to store user names.

Note that with `filterUser` true, `trackUser` is implied and its setting, if present, is ignored.

The `userColumn` setting is a Digitizer / Data Manager extension and not documented (nor implemented) by the data-source package.

Configuring feature display and interface behaviour
---------------------------------------------------

[](#configuring-feature-display-and-interface-behaviour)

Each schema may define the following values to control basic behaviour:

nametypedescriptiondefaultsearchTypestring or nullInitial state of checkbox for limiting feature loading to current visible map portion. On if exactly "currentExtent". Off for all other valuescurrentExtentallowRefreshbooleanOffer button to reload data (for tables frequently modified by concurrent users)falseallowChangeVisibilitybooleanOffer buttons to toggle feature visibilitytruedisplayPermanentbooleanKeep features visible on map even after switching to a different schemafalsedisplayOnInactivebooleanKeep features visible on map even after deactivating DigitizerfalsecontinueDrawingAfterSavebooleanKeep drawing tool active after creating and saving a new feature (~fast batch mode feature creation)falserefreshLayersAfterFeatureSavelist of strings and / or numbersMapbender source instance ids (refer to "Layersets" tab in application backend) that will reload after any item is created, updated or deleted-none-Configuring "toolset"
---------------------

[](#configuring-toolset)

Each schema may define a `toolset` setting to configure the types of drawing tools available during geometry creation. This should be a list of strings, or null for auto-configuration (which is the default).

Valid tool names are:

- `drawPoint` for point creation
- `drawLine` for line drawing
- `drawPolygon` for polygon drawing
- `drawRectangle`, `drawCircle`, `drawEllipse` for rectangles, circles and ellipses respectively
- `drawDonut` for making interior cutouts in existing polygons

If `toolset` is set as an empty list, no geometry creation tools will be offered.

If `toolset` is null or not set, and the connected feature type declares its `geomType`, Digitizer will reduce the selection of tools to to those compatible with the `geomType` (e.g. no line drawing for datasets containing only points or polygons).

If neither `toolset` nor the `geomType` are defined, all supported tools are offered.

If feature modification is allowed (via `allowDigitize` / `allowEdit`), vertex modification and feature translation tools will also be offered.

If `allowCreate` is set to false, no creation tools from the `toolset` setting will be offered. `drawDonut` (inherently a modification, not creation tool) may still be offered, if editing is allowed.

Configuring tabular item listing
--------------------------------

[](#configuring-tabular-item-listing)

Each schema configuration contains an object under key `table` with the following structure:

nametypedescriptiondefaultcolumnslist of objects with `data` and `label` entriesmaps database columns to HTMl table columnsDisplay primary key onlysearchingbooleanEnables display filtering by search termtruepageLengthintegerLimits the number of rows per page16Combination schema
------------------

[](#combination-schema)

If a schema defines a `combine` setting (list of strings), it is treated as a combination schema. Data from multiple other schemas is then displayed together. The entries in the `combine` list must be the names of the sub-schemas to be combined.

A schema with `combine` only allows a reduced set of other settings.

It may define `roles` to limit user access to the whole combination.

It may define `table` to explicitly specify table formatting of data common to all referenced sub-schemas.

A schema referenced by a `combine` list *may* *not* itself define `combine`.

Configuring forms
-----------------

[](#configuring-forms)

Each schema configuration contains a list of (potentially nested) objects under key `formItems`, defining the contents and structure of the form shown when an item is created or edited. Note that this form will also be used purely as a detail display vehicle even if editing is disabled.

Additionaly, the `popup` object in the schema controls properties of the the popup itself. It supports the following values:

nametypedescriptiondefaulttitlestringPopup title text"Edit" (localized)widthstringvalid CSS width rule"550px"### Form input fields

[](#form-input-fields)

Form input fields come in a multitude of different types, controlled by the `type`value. All inputs share a common set of configuration options:

nametypedescriptiondefaulttypestringType of form input field (see below)-none-namestringDatabase column mapped to the input-none-valuestringInitial field value on newly created items-none-titlestringLabel text for form input field-none-attrobjectMapping of HTML attributes to add to the input-none-infoTextstringExplanatory text placed in a tooltip next to the label-none-cssobjectMapping of CSS rules to add to the form group (container around label and input)-none-cssClassstringAdded to the class attribute of the form group (container around label and input)-none-Input field `type` is one of

- "input" for a [regular single-row text input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text)
- "textArea" for a [multiple-row text input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea)
- "select" for a [dropdown offering predefined choices](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select)
- "radioGroup" for an expanded list of [predefined choices](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio)
- "checkbox" for an [on / off choice](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox)
- "date" for a [specialized input selecting a calendar day](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date) (produces standard SQL date string format "YYYY-MM-DD")
- "colorPicker" for a [specialized input selecting a color](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color) (produces CSS-like hash + 6 hex digits string format)
- "file" for [allowing file attachments](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file)

Many common customizations for inputs can be performed purely with the `attr` object. E.g. type "input" can be restricted to allow numbers only by overriding its HTML type attribute; all inputs can be made required or readonly.

```

formItems:
  - type: input
    name: strictly_formatted_column
    title: Strict input pattern demo
    attr:
        pattern: '\w{2}\d{3,}'
        placeholder: Two letters followed by at least three digits
        required: true
  - type: input
    name: numeric_column
    title: Numbers only
    attr:
      type: number
      min: 10
      max: 200
      step: 10
      required: true
  - type: textArea
    name: text_column
    title: Very large text area
    attr:
      rows: 10
```

#### Choice input option formats

[](#choice-input-option-formats)

Types "radioGroup" and "select" require a list of objects under key `options` to specify the available choices. Option objects contain:

nametypedescriptiondefaultvaluestringGenerated database value for the choice-none-labelstringDisplayed text for the choiceSame as valueattrobjectMapping of HTML attributes to add to the individual HTML `` or ``-none-```

formItems:
  - type: select
    options:
      # Allow user to explicitly (re)select ~nothing in particular
      - label: ''
        value: ''
      - label: First option text   # displayed
        value: v1   # value in database column
      - label: Second option text (disabled)
        value: v2
        attr:
          disabled: true
      - label: Third option text
        value: v3
```

Selects (NOT radioGroup items) can alternatively specify `sql`and `connection` (Doctrine DBAL connection name) to generate choices dynamically. The `sql` *should* generate `label` and `value` aliases for clarity. If it does not, the first column of each row is used as the option label and the last column as the submit value.

Static `option` definitions and `sql` can also be combined.

```

formItems:
  - type: select
    options:
      # Allow user to explicitly (re)select ~nothing in particular
      - label: ''
        value: ''
      - label: Static option a
        value: a
    sql: SELECT CONCAT("label_prefix", ': ', "name") AS label, "id" AS value FROM "some_table"
    connection: name_of_some_connection
```

If `sql` is defined but `connection` is omitted, the "default" DBAL connection is used for the query.

#### File uploads

[](#file-uploads)

Files uploaded through `type: file` form items will be stored in the server's file system. The mapped database column will only store a file path as a string.

The default storage path for uploads is determined by Mapbender, but can be reconfigured on the "dataStore" / "featureType" level, individually for each database column. This is done via a `files` object in the "dataStore" / "featureType" configuration.

E.g.

```
schemes:
  items_with_customized_upload_location:
    dataStore:
        connection: dm_connection_name
        table: items_with_file_attachments
        ## Customization per column here
        files:
          - field: attachment_path_column
            path: /var/mapbender-attachments/dm/items_with_customized_upload_location/attachment_path_column
```

The starting point for a relative `path` (no leading slash) is the web server document root.

For image attachments, you may link a `type: img` item that will automatically display a preview of the current attachment.

```

formItems:
    - type: file
      title: Attached image
      name: img_path_column
      attr:
        accept: 'image/*'
    - type: image
      name: img_path_column   # Link to input established by matching "name" value
      src: attachment-placeholder.png
```

### Structural / misc form elements

[](#structural--misc-form-elements)

#### Type "tabs"

[](#type-tabs)

Complex form dialogs can be organized into multiple tabs by inserting an object with `type: tabs`into the `formItems` list, and assigning it one or more tab specifications, which consist of `title` (text displayed on the tab) and `children` (contents of the tab).

```

popup:
  title: 'Multi-tab form dialog'
formItems:
  - type: tabs
    children:
      - title: 'First tab'
        children:
          # First tab form item specifications
          - type: input
            title: Input in first tab

      - title: 'Second tab'
        children:
          # First tab form item specifications
          - type: input
            title: Input in second tab
```

### Misc container tags "div", "span", "p"

[](#misc-container-tags-div-span-p)

Inserts HTML ``, `` or `` tags. May specify `text` (encoded, inserted first) and `children` (list of more items to insert). Supports adding free-form HTML attributes via `attr` object and custom `cssClass`.

```

formItems:
  - type: p
    text: This is an introductory paragraph.
  # Arrange inputs in Bootstrap grid row + columns
  - type: div
    cssClass: row
    children:
      - type: input
        title: Input in left column
        cssClass: col-xs-4 col-4
      - type: input
        title: Input in middle column
        cssClass: col-xs-4 col-4
      - type: input
        title: Input in right column
        cssClass: col-xs-4 col-4
```

### Type "html"

[](#type-html)

Inserts custom HTML content (no escaping), wrapped into an extra div. May specify `attr` and `cssClass` to be added onto the containing div.

```

formItems:
  - type: html
    html: 'This will not go through any HTML escaping.'
    cssClass: added-on-wrapping-div
```

#### Type "breakLine"

[](#type-breakline)

Inserts a single HTML `` element. Supports adding free-form HTML attributes via `attr` object and custom `cssClass`.

Configuring access
------------------

[](#configuring-access)

Each schema may also limit the possible interactions users can perform:

nametypedescriptiondefaultallowCreatebooleanEnables creation of new itemstrueallowEditbooleanEnables editing of existing itemstrueallowDeletebooleanEnables deletion of existing itemstrueallowRefreshbooleanAdd button to explicitly reload items from databasefalseExample configuration
---------------------

[](#example-configuration)

```
schemes:
  a_demo_schema:
    label: Demo   # displayed in schema selector, if multiple schemes configured
    dataStore:
      connection: dm_connection_name
      table: dm_items
      uniqueId: id
    allowEdit:    true    # Can edit existing items
    allowCreate:  true    # Can create new items from scratch
    allowDelete:  false   # Can not delete anything
    allowRefresh: true    # Enable item refresh button
    table:
      columns:
      - data: id
        title: ID
      - data: name
        title: Item name
    popup:
      title: 'Edit dialog title'
      width: 50vw   # half screen width
    formItems:
    - type: p
      text: This is a non-interactive introductory paragraph.
    - type: input
      name: name
      infoText: This will show up in a tooltip next to the label.
      title: Item name
      attr:
        placeholder: 'Entry required'
        required: true
    - type: textArea
      name: description
      title: Longer description text
      attr:
        rows: 4
    - type: radioGroup
      title: Choose one
      name: choice_column_1
      options:
        - label: Option 1
          value: v1
        - label: Option 2
          value: v2
      value: v2   # Pre-select second option by default for new items
    - type: select
      title: Select at least one (multiple choice)
      attr:
        required: required
        multiple: multiple
      name: choice_column_2
      options:
        - label: Option 1
          value: v1
        - label: Option 2 (disabled)
          value: v2
          attr:
            disabled: disabled
        - label: Option 3
          value: v3
      value: v1,v3   # use comma-separated values for default multi-select value
```

Data Source
===========

[](#data-source)

Components abstracting raw doctrine tables into repositories.

The base DataStore is a repository promoting loaded rows into DataItem objects, and also supports DataItem objects when updating / inserting.

FeatureType is an extended repository type with spatial data support. It loads / stores Feature objects, with dedicated methods for accessing / replacing the geometry. The geometry is internally always an EWKT, but methods are provided to get / update the plain WKT or the SRID individually.

Only a single geometry column per table is supported.

Main repository methods
-----------------------

[](#main-repository-methods)

Method `search` loads all rows from the table and promotes them into an array of DataItem / Feature objects. Accepts an array of controlling parameters. Allowed params are `maxResults`, `where` (string; additional SQL where clause). FeatureType additionally supports params `srid` (explicit geometry output SRID) and `intersect`(string; (E)WKT geometry to spatially limit results).

Method `count` Accepts the same parameters as search, but returns only the number of matched rows.

Method `getById` loads one DataItem / Feature. Filters are skipped.

Methods `save`, `insert`, `update` perform storage. `save` auto-inflects to insert or update, depending on the presence of an id in the passed argument. These methods accept either DataItem / Feature objects or arrays. The affected or new row is reloaded and returned as a DataItem / Feature object.

Method `delete` removes the row corresponding with an id or a specific DataItem / Feature object.

Configuring repositories
------------------------

[](#configuring-repositories)

Named DataStore / FeatureType repositorys can be pre-configured globally via container parameters (`dataStores` and `featureTypes` respectively), or instantiated ad hoc from a configuration array.

DataStore configuration supports the following values:

nametypedescriptiondefaultconnectionstringname of doctrine connection"default"tablestringname of table; required-none-uniqueIdstringname of primary id column"id"fieldslist of stringsnames of columns to load into DataItem / Feature objectsnull (=auto-detect columns)filterstringvalid SQL where clause to build into all `search` invocationsnullgeomField (FeatureType only)stringname of the geometry column"geom"srid (FeatureType only)integer or nullSource srid of `geomField`; used only if detection fails (certain views)nullNOTE: you should *not* attempt placing spatial data into the "default" database containing your Doctrine entities. You *will* encounter errors running Doctrine schema updates.

NOTE: Both the `filter` setting and the `where` search param may use a magic placeholder `:userName`, which is automatically bound to the name of the user running the query.

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity33

Limited adoption so far

Community33

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Recently: every ~39 days

Total

167

Last Release

8d ago

Major Versions

1.5.7 → 2.0.02024-06-26

2.0.9 → 3.0.0-RC12026-06-26

PHP version history (3 changes)1.0PHP &gt;=5.3.0

1.0.2PHP &gt;=5.3.3

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e93698c8e1784f88100eab35a186fab222bcbb5dc805d52f36cb6c459fa4743c?d=identicon)[werrolf](/maintainers/werrolf)

![](https://www.gravatar.com/avatar/0154eb5bdfa738d2bbc95bb345ba5f971d9395a2318f8724e42fa3bd384ae9c2?d=identicon)[LazerTiberius](/maintainers/LazerTiberius)

![](https://www.gravatar.com/avatar/edc576f86046edb0015945a3a3d25416817641cf746711c59574662cc7b9a791?d=identicon)[Phocacius](/maintainers/Phocacius)

![](https://www.gravatar.com/avatar/ebb4ec9ae68f36a1f5a3fd3b71b42a4029484a70e5f4c59bb7fb76b09f0d9e6e?d=identicon)[astroidex](/maintainers/astroidex)

![](https://www.gravatar.com/avatar/b0e6d1c4e5a64c805c15f87cf2ec0ab9b79a610bfd77ab189e9126a1a179e0b3?d=identicon)[jheinrichwg](/maintainers/jheinrichwg)

![](https://avatars.githubusercontent.com/u/44997160?v=4)[Felix Rauch](/maintainers/frwg)[@frwg](https://github.com/frwg)

![](https://www.gravatar.com/avatar/4ab55bceb0821487925aaf18e99eefa1a8a046463b49c9eea7417052b41aaab4?d=identicon)[paul.schell](/maintainers/paul.schell)

![](https://www.gravatar.com/avatar/477770124fbda6af8025e087fcf19d606bd95f9c4322f9b53035fb617117300f?d=identicon)[AxxL](/maintainers/AxxL)

---

Top Contributors

[![werrolf](https://avatars.githubusercontent.com/u/24895932?v=4)](https://github.com/werrolf "werrolf (762 commits)")[![frwg](https://avatars.githubusercontent.com/u/44997160?v=4)](https://github.com/frwg "frwg (432 commits)")[![eSlider](https://avatars.githubusercontent.com/u/1188335?v=4)](https://github.com/eSlider "eSlider (344 commits)")[![Phocacius](https://avatars.githubusercontent.com/u/3438255?v=4)](https://github.com/Phocacius "Phocacius (105 commits)")[![DavidPatzke](https://avatars.githubusercontent.com/u/5700151?v=4)](https://github.com/DavidPatzke "DavidPatzke (74 commits)")[![astroidex](https://avatars.githubusercontent.com/u/996298?v=4)](https://github.com/astroidex "astroidex (24 commits)")[![PhilVanB](https://avatars.githubusercontent.com/u/24896163?v=4)](https://github.com/PhilVanB "PhilVanB (12 commits)")[![ArnoFleckenstein](https://avatars.githubusercontent.com/u/87707521?v=4)](https://github.com/ArnoFleckenstein "ArnoFleckenstein (8 commits)")[![inacht](https://avatars.githubusercontent.com/u/38423161?v=4)](https://github.com/inacht "inacht (5 commits)")[![CViescaA](https://avatars.githubusercontent.com/u/93977488?v=4)](https://github.com/CViescaA "CViescaA (5 commits)")[![AxxL](https://avatars.githubusercontent.com/u/2235393?v=4)](https://github.com/AxxL "AxxL (3 commits)")[![pfavero-wheregroup](https://avatars.githubusercontent.com/u/45092671?v=4)](https://github.com/pfavero-wheregroup "pfavero-wheregroup (2 commits)")[![Olga-Mishareva](https://avatars.githubusercontent.com/u/94528652?v=4)](https://github.com/Olga-Mishareva "Olga-Mishareva (2 commits)")[![dani-li](https://avatars.githubusercontent.com/u/119951139?v=4)](https://github.com/dani-li "dani-li (2 commits)")

---

Tags

mapbenderdigitizerdigitizing

### Embed Badge

![Health badge](/badges/mapbender-digitizer/health.svg)

```
[![Health](https://phpackages.com/badges/mapbender-digitizer/health.svg)](https://phpackages.com/packages/mapbender-digitizer)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M204](/packages/sulu-sulu)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[codefog/contao-haste

haste extension for Contao Open Source CMS

46676.5k171](/packages/codefog-contao-haste)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
