Skip to content

Commit

Permalink
Use metadata to select what column use for popup selection in edition
Browse files Browse the repository at this point in the history
  • Loading branch information
llienher authored and sbrunner committed Aug 14, 2023
1 parent edacd02 commit 5613b64
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 5613b64

Please sign in to comment.