I'm working with 3.22.10-Białowieża and I need to create several maps of the same location, showing a different layer in each (i.e. heatmaps for different years). This is the workflow that I have set, but still needs a final fix:
- Create a layer (years) with no geometries and filled it with the names of the layers I want to use (an easy automated task, since the names are correlative: heatmap_1999, heatmap_2000...);
- Create a new print layout with the map extent I need;
- Create an atlas for that layout, using the
yearslayer as coverage;
- Set the visibility of the layers in the
Element propertiesof the map with the expression
- Create the atlas preview, and it correctly shows each layer in each page.
So far, so good. However, I need to add a baselayer to the view and I've tried the following expression, but it doesn't work as expected:
Instead of this (obtained when the atlas preview is switched off):
I get this:
How can it be done?
Here is a sample project (hope I've used the
Project Packager complement properly). For the base layer I'm using a WMS and double-clicking on its name when constructing the expression, so misspelling shouldn't be the problem -> Well, it turns out yes: see the answer by @Babel below.