Skip to content
Open
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions browser/modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module.exports = {
emptyInfoCallback: null,
infoCallback: null,
dateFormats: {},
showNoValueInInfo: false,
};
// Set session from URL
if (typeof urlVars.session === "string") {
Expand Down
14 changes: 12 additions & 2 deletions browser/modules/sqlQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ let defaultTemplate =
{{/_vidi_content.fields}}
</div>`;

let defaultTemplateWithNoValue =
`<div class="vidi-popup-content">
<h3 class="popup-title">{{_vidi_content.title}}</h3>
{{#_vidi_content.fields}}
<h4>{{title}}</h4>
<p {{#if type}}class="{{type}}"{{/if}}>{{{value}}}</p>
{{/_vidi_content.fields}}
</div>`;

const defaultTemplateForCrossMultiSelect =
`<div class="vidi-popup-content">
{{#_vidi_content.fields}}
Expand Down Expand Up @@ -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 = `
<button class='btn btn-sm btn-outline-secondary mb-2 show-when-multiple-hits'>
<i class='bi bi-arrow-left'></i> ${__("Back")}
</button>` + defaultTemplate;
</button>` + useTemplate;
$(document).arrive('.show-when-multiple-hits', function (e, data) {
$(this).on('click', function (e) {
$("#modal-info-body").show();
Expand Down Expand Up @@ -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();
Expand Down
Binary file added docs/_media/infobox-novalue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions docs/pages/standard/91_run_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down