Coverage for gws-app/gws/plugin/legend/__init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-05 13:35 +0200

1"""Legend types. 

2 

3A legend is configured with ``legend`` on a layer. Each legend type renders 

4one image. Several images are combined vertically into one with 

5``gws.base.legend.combine_outputs``. Layers from WMS services and QGIS 

6projects create their legends automatically if no ``legend`` is configured. 

7 

8Subpackages 

9----------- 

10 

11- ``combined`` - combines the legends of other layers, given by uid. 

12- ``html`` - renders an HTML template to a PNG image. 

13- ``remote`` - downloads images from URLs and combines them. 

14- ``static`` - an image file. 

15 

16Example:: 

17 

18 map.layers+ { 

19 title "OpenStreetMap" 

20 type "tile" 

21 provider.url "https://tile.openstreetmap.org/{z}/{x}/{y}.png" 

22 legend { 

23 type "static" 

24 path "osm_legend.png" 

25 } 

26 } 

27"""