From 774d8aaaefafe314fd9d37312a7af46a9178bbe0 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 27 Nov 2024 09:26:37 +0100 Subject: [PATCH] Only add external layer print params for background layer printLayer defined via resource string if printExternalLayers=true --- utils/LayerUtils.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/utils/LayerUtils.js b/utils/LayerUtils.js index 1def82a4f..5ce51b74a 100644 --- a/utils/LayerUtils.js +++ b/utils/LayerUtils.js @@ -894,12 +894,14 @@ const LayerUtils = { if (printBgLayerName) { let match = null; if ((match = printBgLayerName.match(/^(\w+):(.*)#([^#]+)$/)) && match[1] === "wms") { - const layer = { - type: 'wms', - params: {LAYERS: match[3], OPACITIES: '255', STYLES: ''}, - url: match[2] - }; - LayerUtils.addExternalLayerPrintParams(layer, params, printCrs, counterRef); + if (printExternalLayers) { + const layer = { + type: 'wms', + params: {LAYERS: match[3], OPACITIES: '255', STYLES: ''}, + url: match[2] + }; + LayerUtils.addExternalLayerPrintParams(layer, params, printCrs, counterRef); + } } else { params.LAYERS.push(printBgLayerName); params.OPACITIES.push("255");