diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ba9ff2d9..2679b6436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [CalVer](https://calver.org/). ## [UNRELEASED] - 2025-724-2 - +- showNoValueInInfo config for displaying all attributes in feature-info. Default attributes with missing values is not in the dialog. ### Added - The default coordinate system can now be set in Coordinates module: diff --git a/browser/modules/init.js b/browser/modules/init.js index 470f3351f..4a0924029 100644 --- a/browser/modules/init.js +++ b/browser/modules/init.js @@ -96,6 +96,7 @@ module.exports = { emptyInfoCallback: null, infoCallback: null, dateFormats: {}, + showNoValueInInfo: false, }; // Set session from URL if (typeof urlVars.session === "string") { diff --git a/browser/modules/sqlQuery.js b/browser/modules/sqlQuery.js index ebe276b40..430ccfa30 100644 --- a/browser/modules/sqlQuery.js +++ b/browser/modules/sqlQuery.js @@ -84,6 +84,15 @@ let defaultTemplate = {{/_vidi_content.fields}} `; +let defaultTemplateWithNoValue = + `
+ + {{#_vidi_content.fields}} +

{{title}}

+

{{{value}}}

+ {{/_vidi_content.fields}} +
`; + const defaultTemplateForCrossMultiSelect = `
{{#_vidi_content.fields}} @@ -262,10 +271,11 @@ module.exports = { // Back arrow to template if featureInfoTableOnMap is true if ((featureInfoTableOnMap || forceOffCanvasInfo) && !backArrowIsAdded) { + const useTemplate = window.vidiConfig.showNoValueInInfo ? defaultTemplateWithNoValue : defaultTemplate; defaultTemplateWithBackBtn = ` ` + defaultTemplate; + ` + useTemplate; $(document).arrive('.show-when-multiple-hits', function (e, data) { $(this).on('click', function (e) { $("#modal-info-body").show(); @@ -936,7 +946,7 @@ module.exports = { const map = cloud.get().map const draggable = new L.Draggable(popup._container, popup._wrapper); // change cursor class - $(".leaflet-popup-content-wrapper").css('cursor', 'move'); + $(".leaflet-popup-content-wrapper").css('cursor', 'move'); draggable.on('dragstart', function (e) { //on first drag, remove the pop-up tip $(".leaflet-popup-tip-container").hide(); diff --git a/docs/_media/infobox-novalue.png b/docs/_media/infobox-novalue.png new file mode 100644 index 000000000..6f81bec40 Binary files /dev/null and b/docs/_media/infobox-novalue.png differ diff --git a/docs/pages/standard/91_run_configuration.rst b/docs/pages/standard/91_run_configuration.rst index 6f5f73974..456d1730c 100644 --- a/docs/pages/standard/91_run_configuration.rst +++ b/docs/pages/standard/91_run_configuration.rst @@ -395,6 +395,28 @@ Ved brug af "avanceret forespørgelse" vises tabellerne dog stadig i sidepanelet .. note:: Kan ikke anvendes i sammenhæng med :ref:`configjs_crossmultiselect` +.. _configjs_crossmultiselect: + +showNoValueInInfo +***************************************************************** + +Når denne er sat til ``true`` vises alle attributter i feature-info dialogen, selv om der ikke er registreret en værdi. +Det giver et mere ensartet indhold af dialogen. At en attribut ikke er tildelt en værdi kan også være en nyttig information. +I eksempelet nedenfor viser at "Fysisk indeks" på den udpegede ledning, ikke har en værdi. + +.. code-block:: json + + "showNoValueInInfo": true, + +.. figure:: ../../_media/infobox-novalue.png + :width: 400px + :align: center + :name: no-value-in-info + :figclass: align-center +| + + + .. _configjs_crossmultiselect: crossMultiSelect