Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport master] Use metadata to select what column use for popup selection in edition #9189

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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