Fetch (and cache) the layers of a map.

This is particularly useful if you want to use sliders or buttons to quickly switch between the layers (e.g. once the backgrounds are cached, switching layers will be fast).

Note: After zooming or re-sizing the map, the cache is cleared and you need to call this function again.


layers (list or None, optional) – A list of layer-names that should be fetched. If None, all layers (except the β€œall” layer) are fetched. The default is None.

See also


use a keypress callback to fetch layers