mapbender / digitizer
Mapbender digitizer element
Installs: 16 089
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 19
Forks: 8
Open Issues: 4
Language:JavaScript
Requires
- php: >=8.1
- blueimp/jquery-file-upload: 9.*
- doctrine/dbal: ^2.11 || ^3
- doctrine/persistence: ^2 || ^3
- mapbender/mapbender: ^4
Provides
Conflicts
- mapbender/openlayers6-es5: <0.3.5
Replaces
- dev-release/1.1
- 2.0.2
- 2.0.1
- 2.0.0
- dev-staging/1.6 / 1.6.x-dev
- dev-master / 1.5.x-dev
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- dev-release/1.4 / 1.4.x-dev
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4
- 1.4-beta2
- 1.4-beta1
- v1.3-beta2
- 1.2-RC9
- 1.2-RC8
- 1.2-RC7
- 1.2-RC6
- 1.2-RC5
- 1.2-RC4
- 1.2-RC3
- 1.2-RC2
- 1.2-RC1
- 1.1.73
- 1.1.72.1
- 1.1.72
- 1.1.71
- 1.1.70
- 1.1.69
- 1.1.68
- 1.1.67
- 1.1.66
- 1.1.65
- 1.1.64
- 1.1.63
- 1.1.62
- 1.1.61
- 1.1.60
- 1.1.59
- 1.1.58
- 1.1.57
- 1.1.56
- 1.1.55
- 1.1.54
- 1.1.53
- 1.1.51
- 1.1.50
- 1.1.49
- 1.1.48
- 1.1.47
- 1.1.46
- 1.1.45
- 1.1.44
- 1.1.43
- 1.1.41
- 1.1.40
- 1.1.39
- 1.1.38
- 1.1.37
- 1.1.36
- 1.1.35
- 1.1.34
- 1.1.33
- 1.1.32
- 1.1.31
- 1.1.30
- 1.1.29
- 1.1.28
- 1.1.27
- 1.1.26
- 1.1.25
- 1.1.24
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0
- dev-develop
- dev-feature/enableCreationOfSeveralFeaturesAtOnce
- dev-feature/reEnableImageCssOnFormItemImage
- dev-develop-compatible-with-mb-3.3.5
- dev-fix/enableDataIntegrityAfterSavingInDataManager
- dev-work/improve-digitizer-popup-design
- dev-feature/button-customisation
- dev-feature/preventDrawDonutOnNonDigitizerFeatures
- dev-feature/allowDeletionOfVerticesAndPreventSelfIntersection2
- dev-feature/allowDeletionOfVerticesAndPreventSelfIntersection
- dev-feature/spanish-translation
- dev-feature/update-to-version-4
- dev-feature/snap-integration
- dev-customer-A1020
- dev-feature/enableDBSIMMSupport
- dev-feature/enableDBSIMMSupport-prepareForMerge
- dev-feature/bootstrap-update
- dev-work/remove-deprecations
- dev-customer-60329-1.6
- dev-feature/revertGeometryAfterFailedSave
- dev-Deactivate-active-Drawing-Tool-on-Dialog-Close
- dev-feature/deactivateActiveDrawingToolOnDialogClose
- dev-release/1.2
- dev-fix/13-forward-compat
- dev-feature/60329-mb32x
- dev-release/1.3
- dev-release/1.2-coordinates
- dev-fix/bugfixesForLatestMapbender
- dev-fix/GleicheObjektinformationBeiDruckBeiAuswahlEinesAnderenObjekts
- dev-release/1.2-mainz
- dev-release/1.3-objectsearch
- dev-release/1.3-coordinates
- dev-release/1.3-reintegrateSelectAndRemoveSelected
- dev-feature/digitizerMobileDevices
- dev-customer-60329
- dev-feature/download_file_uri
- dev-release/1.0
This package is auto-updated.
Last update: 2024-11-11 08:50:57 UTC
README
⚠️ This version is compatible with Mapbender 4 only. The latest digitizer release compatible with Mapbender 3 is 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 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
Using Digitizer requires registering two bundles in your application kernel. Register both
\Mapbender\DataManagerBundle\MapbenderDataManagerBundle
and \Mapbender\DigitizerBundle\MapbenderDigitizerBundle
.
Configuring feature interactions
Each schema may define the following values to control access to data modifying interactions:
The 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
Data shown in each schema can be separate for different users. Each schema may define:
Setting 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
Each schema may define the following values to control basic behaviour:
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 creationdrawLine
for line drawingdrawPolygon
for polygon drawingdrawRectangle
,drawCircle
,drawEllipse
for rectangles, circles and ellipses respectivelydrawDonut
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
Each schema configuration contains an object under key table
with the following structure:
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
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:
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:
Input field type
is one of
- "input" for a regular single-row text input
- "textArea" for a multiple-row text input
- "select" for a dropdown offering predefined choices
- "radioGroup" for an expanded list of predefined choices
- "checkbox" for an on / off choice
- "date" for a specialized input selecting a calendar day (produces standard SQL date string format "YYYY-MM-DD")
- "colorPicker" for a specialized input selecting a color (produces CSS-like hash + 6 hex digits string format)
- "file" for allowing file attachments
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
Types "radioGroup" and "select" require a list of objects under key
options
to specify the available choices. Option objects contain:
<...> 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
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
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"
Inserts HTML <div>
, <span>
or <p>
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"
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 <strong>not</strong> go through any HTML escaping.' cssClass: added-on-wrapping-div
Type "breakLine"
Inserts a single HTML <hr>
element. Supports adding free-form HTML attributes via attr
object and custom cssClass
.
Configuring access
Each schema may also limit the possible interactions users can perform:
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
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
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
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:
NOTE: 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.