mapbender / digitizer
Mapbender digitizer 元素
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.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-fix/enableDataIntegrityAfterSavingInDataManager
- dev-develop-compatible-with-mb-3.3.5
- 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-09-25 08:15:19 UTC
README
⚠️ 此版本仅与 Mapbender 4 兼容。与 Mapbender 3 兼容的最新 digitizer 版本是 1.5.7
在 Mapbender 应用中显示和编辑存储在数据库表中的要素(以及要素属性)。
要素列表以(HTML)表格的形式显示。可以使用预定义的工具集创建或编辑几何形状,并且它们的属性可以自定义表单。
设计用于侧边栏。
数据组织成“方案”以支持多个数据库表的集成。
如果定义了多个方案,Digitizer 将显示下拉列表以允许切换方案。
每个方案分别定义工具可用性、数据列表方式和用于编辑属性的表单结构。
连接到 PostgreSQL Postgis 或 Oracle 空间数据库表。请参阅 数据源文档 获取详细信息。
连接和表配置可以内联到方案配置中,也可以引用现有的全局配置,并将其放置到 Symfony 容器参数中。
Digitizer 不支持没有几何列的表。
安装后
使用 Digitizer 需要在您的应用程序内核中注册 两个 包。注册 两个 \Mapbender\DataManagerBundle\MapbenderDataManagerBundle
和 \Mapbender\DigitizerBundle\MapbenderDigitizerBundle
。
配置要素交互
每个方案可以定义以下值以控制对数据修改交互的访问
roles
列表应包含由 Symfony 授予系统理解的条目,例如 ROLE_USER
用于已登录用户或 ROLE_GROUP_SOMETHING
用于在 Mapbender 管理后端创建和分配的用户组。
上述 allow... 设置也可以包含角色名称列表,以限制修改仅限于某些用户组。如果它们是布尔值,则对所有用户(包括匿名用户)的访问是统一的。
用户特定数据
每个方案中显示的数据可以针对不同用户分开。每个方案可以定义
将这些之一设置为 true 还需要定义 userColumn
(字符串)以在数据存储/要素类型定义中。这必须命名一个足够长的数据库列以存储用户名。
请注意,当 filterUser
为 true 时,隐含 trackUser
并忽略其设置(如果存在)。
userColumn
设置是 Digitizer / 数据管理器扩展,并未在数据源包中记录(也未实现)。
配置要素显示和界面行为
每个方案可以定义以下值以控制基本行为
配置“工具集”
每个方案可以定义一个 toolset
设置来配置几何形状创建期间可用的绘图工具类型。这应该是一个字符串列表,或为自动配置(默认值)指定 null。
有效的工具名称是
drawPoint
用于点创建drawLine
用于线绘制drawPolygon
用于多边形绘制drawRectangle
、drawCircle
、drawEllipse
分别用于矩形、圆形和椭圆drawDonut
用于在现有多边形中制作内部切孔
如果将 toolset
设置为空列表,则不会提供任何几何创建工具。
如果 toolset
为空或未设置,并且连接的特征类型声明了其 geomType
,数字化器将减少工具选择,只提供与 geomType
兼容的工具(例如,对于只包含点和多边形的数据集,则不提供绘制线条的工具)。
如果既未定义 toolset
也未定义 geomType
,则提供所有支持的工具。
如果允许特征修改(通过 allowDigitize
/ allowEdit
),则还会提供顶点修改和特征平移工具。
如果将 allowCreate
设置为 false,则不会提供来自 toolset
设置的任何创建工具。如果允许编辑,则可能仍然提供 drawDonut
(本质上是一个修改工具,而不是创建工具)。
配置表格项列表
每个模式配置都包含一个键为 table
的对象,其结构如下
组合模式
如果模式定义了一个 combine
设置(字符串列表),则它被视为组合模式。然后,将显示多个其他模式的数据。 combine
列表中的条目必须是应组合的子模式名称。
只有 combine
的模式允许一组减少的其他设置。
它可以定义 roles
以限制用户对整个组合的访问。
它可以定义 table
以显式指定所有引用子模式共有的数据表格格式。
被 combine
列表引用的模式可能不自己定义 combine
。
配置表单
每个模式配置都包含一个键为 formItems
的对象列表(可能是嵌套的),定义了在创建或编辑项目时显示的表单的内容和结构。请注意,即使禁用编辑,此表单也将仅作为纯详情显示工具使用。
此外,模式中的 popup
对象控制弹出窗口本身的属性。它支持以下值
表单输入字段
表单输入字段有多种类型,由 type
值控制。所有输入共享一组常见的配置选项
输入字段 type
的值之一是
- "input" 用于 常规单行文本输入
- "textArea" 用于 多行文本输入
- "select" 用于提供预定义选择的 下拉列表
- "radioGroup" 用于预定义选择的扩展列表 单选按钮
- "checkbox" 用于 开/关选择
- "date" 用于选择日历日期的 特殊输入(产生标准 SQL 日期字符串格式 "YYYY-MM-DD")
- "colorPicker" 用于选择颜色的 特殊输入(产生类似 CSS 的哈希 + 6 个十六进制数字字符串格式)
- "file" 用于 允许文件附件
可以使用 attr
对象执行许多输入的常见自定义。例如,可以通过覆盖其 HTML 类型属性将 "input" 类型限制为仅允许数字;所有输入都可以设置为必填或只读。
<...> 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
选择输入选项格式
类型 "radioGroup" 和 "select" 需要在键 options
下提供一个对象列表,以指定可用的选项。选项对象包含
<...> 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
选择项(NOT radioGroup 项)可以另指定 sql
和 connection
(Doctrine DBAL 连接名称)以动态生成选项。sql
应该生成 label
和 value
别名以提高清晰度。如果没有这样做,则每行的第一列用作选项标签,最后一列用作提交值。
静态 option
定义和 sql
也可以结合使用。
<...> 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
如果定义了 sql
但省略了 connection
,则使用 "default" DBAL 连接进行查询。
文件上传
通过 type: file
表单项上传的文件将存储在服务器的文件系统中。映射的数据库列只存储文件路径作为字符串。
上传的默认存储路径由 Mapbender 确定,但可以在 "dataStore" / "featureType" 级别重新配置,每个数据库列单独进行。这是通过 "dataStore" / "featureType" 配置中的 files
对象完成的。
例如。
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
相对 path
(没有前导斜杠)的起点是 Web 服务器文档根。
对于图像附件,您可以链接一个 type: img
项,它将自动显示当前附件的预览。
<...> 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
结构化/杂项表单元素
类型 "tabs"
通过将一个具有 type: tabs
的对象插入到 formItems
列表,并将一个或多个标签规范分配给它,可以将复杂的表单对话框组织成多个选项卡。标签规范由 title
(显示在标签上的文本)和 children
(选项卡内容)组成。
<...> 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
杂项容器标签 "div","span","p"
插入 HTML <div>
,<span>
或 <p>
标签。可以指定 text
(编码,首先插入)和 children
(要插入的更多项的列表)。支持通过 attr
对象添加自由形式的 HTML 属性和自定义 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
类型 "html"
插入自定义 HTML 内容(无转义),包含在额外的 div 中。可以指定要添加到包含 div 中的 attr
和 cssClass
。
<...> formItems: - type: html html: 'This will <strong>not</strong> go through any HTML escaping.' cssClass: added-on-wrapping-div
类型 "breakLine"
插入单个 HTML <hr>
元素。支持通过 attr
对象添加自由形式的 HTML 属性和自定义 cssClass
。
配置访问权限
每个模式也可以限制用户可以执行的可能交互
示例配置
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
数据源
组件将原始 doctrine 表抽象为存储库。
基本 DataStore 是一个存储库,它将加载的行提升到 DataItem 对象,并且在更新/插入时也支持 DataItem 对象。
FeatureType 是一个支持空间数据的扩展存储库类型。它加载/存储 Feature 对象,并为访问/替换几何形状提供专用方法。几何形状在内部始终是 EWKT,但提供了获取/更新纯 WKT 或 SRID 的方法。
每个表只支持单个几何列。
主要存储库方法
方法 search
从表中加载所有行并将它们提升到 DataItem / Feature 对象的数组。接受一个控制参数数组。允许的参数是 maxResults
,where
(字符串;附加 SQL WHERE 子句)。FeatureType 还支持参数 srid
(显式几何输出 SRID)和 intersect
(字符串;(E)WKT 几何形状以空间限制结果)。
方法 count
接受与 search 相同的参数,但只返回匹配行的数量。
方法 getById
加载一个 DataItem / Feature。跳过筛选器。
方法 save
,insert
,update
执行存储。save
根据传递的参数中是否存在 id 自动推断为插入或更新。这些方法接受 DataItem / Feature 对象或数组。受影响或新的行被重新加载并返回为 DataItem / Feature 对象。
方法 delete
用于删除与指定 id 或特定 DataItem / Feature 对象对应的行。
配置存储库
命名 DataStore / FeatureType 存储库可以通过容器参数(分别对应 dataStores
和 featureTypes
)进行全局预配置,或者从配置数组中即时实例化。
DataStore 配置支持以下值
注意:您不应尝试将空间数据放入包含您的 Doctrine 实体的“默认”数据库中。您在运行 Doctrine 模式更新时将会遇到错误。
注意:filter
设置和 where
搜索参数都可能使用一个魔法占位符 :userName
,它将自动绑定到运行查询的用户名称。