Skip to content

Commit

Permalink
Omit background layer if baseLayer is specified in the map export for…
Browse files Browse the repository at this point in the history
…mat config
  • Loading branch information
manisandro committed Nov 8, 2023
1 parent a24ac71 commit abfbe07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qwc2",
"version": "2023.11.07-master",
"version": "2023.11.08-master",
"description": "QGIS Web Client 2 core",
"author": "Sourcepole AG",
"license": "BSD-2-Clause",
Expand Down
3 changes: 2 additions & 1 deletion plugins/MapExport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ class MapExport extends React.Component {
if (this.state.pageSize === null && this.props.allowedScales !== false) {
scaleFactor = mapScale / this.state.scale;
}
const exportParams = LayerUtils.collectPrintParams(this.props.layers, this.props.theme, mapScale, this.props.map.projection, exportExternalLayers);
const selectedFormatConfiguration = formatConfiguration.find(entry => entry.name === this.state.selectedFormatConfiguration) || {};
const exportParams = LayerUtils.collectPrintParams(this.props.layers, this.props.theme, mapScale, this.props.map.projection, exportExternalLayers, !!selectedFormatConfiguration.baseLayer);
const highlightParams = VectorLayerUtils.createPrintHighlighParams(this.props.layers, this.props.map.projection, mapScale, this.state.dpi);

return (
Expand Down
4 changes: 2 additions & 2 deletions utils/LayerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ const LayerUtils = {
}
}
},
collectPrintParams(layers, theme, printScale, printCrs, printExternalLayers) {
collectPrintParams(layers, theme, printScale, printCrs, printExternalLayers, omitBackgroundLayer) {
const params = {
LAYERS: [],
OPACITIES: [],
Expand All @@ -766,7 +766,7 @@ const LayerUtils = {
}

const backgroundLayer = layers.find(layer => layer.role === LayerRole.BACKGROUND && layer.visibility === true);
if (backgroundLayer) {
if (backgroundLayer && !omitBackgroundLayer) {
const backgroundLayerName = backgroundLayer.name;
const themeBackgroundLayer = theme.backgroundLayers.find(entry => entry.name === backgroundLayerName);
const printBackgroundLayer = themeBackgroundLayer ? themeBackgroundLayer.printLayer : null;
Expand Down

0 comments on commit abfbe07

Please sign in to comment.