Skip to content

Commit

Permalink
Merge pull request #9189 from camptocamp/backport/9184-to-master
Browse files Browse the repository at this point in the history
[Backport master] Use metadata to select what column use for popup selection in edition
  • Loading branch information
sbrunner authored Aug 14, 2023
2 parents edacd02 + 5613b64 commit ee1e183
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/editing/editFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,13 @@ Controller.prototype.openFeatureMenu_ = function (coordinate, features) {
/** @type {import('ngeo/Menu').MenuActionOptions[]} */
const actions = [];
features.forEach((feature) => {
const label = feature.get('name') ? feature.get('name') : feature.getId();
let label = null;
const selectionName = this.editableTreeCtrl.node.metadata['editingSelectionAttribute'];
if (selectionName) {
label = feature.get(selectionName);
} else {
label = feature.get('name') ? feature.get('name') : feature.getId();
}
/** @type {import('ngeo/Menu').MenuActionOptions} */
const choice = {
cls: '',
Expand Down
2 changes: 2 additions & 0 deletions src/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@
* @property {string} [iconUrl] The URL of the icon to display in the layer tree. For every kind of layer.
* @property {string} identifierAttributeField The field used in the 'display query window' as feature title.
* For WMS layers.
* @property {string} editingSelectionAttribute The field used in the selector tooltip to name the layer when multiple ones are selected on the map.
* For WMS layers.
* @property {boolean|undefined} [isChecked=false] Is the layer checked by default. For WMS and WMTS layers.
* @property {boolean|undefined} [isExpanded=false] Whether the layer group is expanded by default. For
* layer groups (only).
Expand Down

0 comments on commit ee1e183

Please sign in to comment.