Skip to content

Commit

Permalink
Document possibility to set printLayer to a resource string
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Oct 20, 2023
1 parent eed54b7 commit ce1209d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/configuration/ThemesConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ The format of the theme definitions is as follows:
| `},` | |
| `"backgroundLayers": [{,` | Optional, list of available background layers, defaults to `defaultBackgroundLayers`. |
| `⁣  "name": "<Background layer name>",` | Name of matching `BackgroundLayerDefinition`, see [below](#background-layers). |
| `⁣  "printLayer": "<QGIS layer name>"\|[<list>],`| Optional, name of layer to use as matching background layer when printing. Alternatively, a list `[{"maxScale": <scale>, "name": "<QGis layer name>"}, ..., {"maxScale": null, "name": "<QGis layer name>"}]` can be provided, ordered in ascending order by `maxScale`. The last entry should have `maxScale` `null`, as the layer used for all remaining scales. If omitted, no background is printed, unless layer is of type `wms` and `printExternalLayers` is `true` in the Print plugin configuration. |
| `⁣  "printLayer": "<layer name>"\|[<list>],` | Optional, a QGIS layer name or layer resource string to use as matching background layer when printing. Alternatively, a list `[{"maxScale": <scale>, "name": "<layer name>"}, ..., {"maxScale": null, "name": "<layer name>"}]` can be provided, ordered in ascending order by `maxScale`. The last entry should have `maxScale` `null`, as the layer used for all remaining scales. If omitted, no background is printed, unless layer is of type `wms` and `printExternalLayers` is `true` in the Print plugin configuration. See [Printing](../topics/Printing.md). |
| `⁣  "visibility": <boolean>`, | Optional, initial visibility of the layer when theme is loaded. |
| `⁣  "overview": <boolean>`, | Optional, set the layer as the overview map layer (i.e. this layer will be displayed in the overview map regardless of the background layer visible in the main map). |
| `}],` | |
Expand Down
10 changes: 7 additions & 3 deletions src/topics/Printing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@ Some additional tasks include:

Background layers are handled purely client-side in QWC2. There are two options for printing the background layer:

The first option is to mark a QGIS project layer as *print layer* by adding a `printLayer` to the background layer entry when writing the [themes configuration](../configuration/ThemesConfiguration.md#manual-theme-configuration), i.e.:
The first option is to add a `printLayer` to the background layer entry when writing the [themes configuration](../configuration/ThemesConfiguration.md#manual-theme-configuration), i.e.:

```json
{
...
"backgroundLayers": [
{"name": "<background layer name>", "printLayer": "<qgis layer name>"}
{"name": "<background layer name>", "printLayer": "<qgis layer name or resource string>"}
]
}
```

A QGIS layer marked as `printLayer` will be filtered out from the QWC2 layer tree, and hence will not be displayed in QWC2. This approach allows i.e. using a WMTS background layer in the web client for higher performance, and using a WMS background layer when printing for higher quality/resolution.
You can set `printLayer` to a QGIS layer name, or to a resource string (i.e. `wms:<baseurl>#<layername>`). A QGIS layer marked as `printLayer` will be filtered out from the QWC2 layer tree, and hence will not be displayed in QWC2.

You can also set `printLayer` to a list `[{"maxScale": <scale>, "name": "<layer name>"}, ..., {"maxScale": null, "name": "<QGis layer name>"}]`, ordered in ascending order by `maxScale`. The last entry should have `maxScale` `null`, as the layer used for all remaining scales.

This approach allows i.e. using a WMTS background layer in the web client for higher performance, and using a WMS background layer when printing for higher quality/resolution.

The second option is to use WMS background layers, which are automatically printed as external layers.

Expand Down

0 comments on commit ce1209d

Please sign in to comment.