Skip to content

Commit

Permalink
UX - Display an error message if the layer is not found in the CFG fi…
Browse files Browse the repository at this point in the history
…le, if admin
  • Loading branch information
Gustry committed Jan 31, 2025
1 parent 719d5b5 commit e706c65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/src/modules/config/LayerTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,12 @@ function buildLayerTreeGroupConfigItems(wmsCapaLayerGroup, layersCfg, level) {
const wmsName = wmsCapaLayer.Name;
const cfg = layersCfg.getLayerConfigByWmsName(wmsName);
if (cfg == null) {
console.log('The WMS layer name `'+ wmsName +'` is unknown!');
const errorMessage = `The WMS layer name "${wmsName}" is unknown. Is the Lizmap configuration file "${lizUrls.params.project}.qgs.cfg" up to date ?`;
console.warn(errorMessage);

if (document && document.body.dataset.lizmapAdminUser === 1) {
lizMap.addMessage(errorMessage, 'warning', true).attr('id', 'lizmap-warning-message');
}
continue;
}
if (wmsCapaLayer.hasOwnProperty('Layer') && wmsCapaLayer.Layer.length != 0) {
Expand Down

0 comments on commit e706c65

Please sign in to comment.