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

0 statements  

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

1"""Tile layers from XYZ tile services. 

2 

3This plugin provides the ``tile`` layer, which shows tiles from a REST tile 

4service whose URL contains the placeholders ``{x}``, ``{y}`` and ``{z}``. 

5 

6Submodules 

7---------- 

8 

9- ``provider`` - the tile service (`provider.Object`). It holds the URL 

10 template, the finest source level and the tile grid of the source 

11 (web mercator by default), and fetches single tiles. 

12- ``layer`` - the ``tile`` image layer. Its extent is the source grid 

13 extent, clipped to the area of use of the grid CRS. 

14- ``grabber`` - the tile grabber. It fetches source tiles through the 

15 provider and mosaics and warps them onto the requested tiles and boxes. 

16 The source tile matrix set is derived from the provider grid, with one 

17 matrix per level up to the provider's ``maxLevel``. 

18 

19The layer supports the usual display modes. With ``display "tile"`` (the 

20default) or ``"box"``, images are served by WebSuite through the grabber and 

21can be cached. With ``display "client"``, the client loads the tiles 

22directly from the source URL, as an ``xyz`` layer. 

23 

24The source grid is assumed to have its origin in the north-west corner 

25(XYZ order); TMS sources with a south-west origin are not supported. 

26 

27Example:: 

28 

29 map.layers+ { 

30 title "OpenStreetMap" 

31 type "tile" 

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

33 display "tile" 

34 withCache true 

35 } 

36"""