Skip to content

Commit

Permalink
Fix: print w/ no baselayer
Browse files Browse the repository at this point in the history
  • Loading branch information
nboisteault committed Aug 17, 2023
1 parent adbc71c commit c4fb911
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/src/components/Print.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,13 @@ export default class Print extends HTMLElement {
opacityLayers.push(255);
}

// Add selected base layer
printLayers.push(lizMap.mainLizmap.state.baseLayers.selectedBaseLayer.layerConfig.shortname);
styleLayers.push(lizMap.mainLizmap.state.baseLayers.selectedBaseLayer.itemState.wmsSelectedStyleName);
opacityLayers.push(parseInt(255 * lizMap.mainLizmap.state.baseLayers.selectedBaseLayer.itemState.opacity * lizMap.mainLizmap.state.baseLayers.selectedBaseLayer.layerConfig.opacity));
// Add selected base layer if any
const selectedBaseLayer = lizMap.mainLizmap.state.baseLayers.selectedBaseLayer;
if (selectedBaseLayer) {
printLayers.push(selectedBaseLayer.layerConfig.shortname);
styleLayers.push(selectedBaseLayer.itemState.wmsSelectedStyleName);
opacityLayers.push(parseInt(255 * selectedBaseLayer.itemState.opacity * selectedBaseLayer.layerConfig.opacity));
}

// Add visible layers
for (const layer of mainLizmap.state.rootMapGroup.findMapLayers().slice().reverse()) {
Expand Down

1 comment on commit c4fb911

@3liz-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest weekly run of end2end "playwright" tests failed with this latest commit on the branch master 😣

CC @nboisteault and @Gustry, please have a look to the logs 💪 Maybe it's a false positive ? 🙍

Visit https://github.com/3liz/lizmap-web-client/actions/runs/5921552759

Please sign in to comment.