fetch_layersο
- attach.fetch_layers(layers=None, verbose=True, key='x')ο
Fetch (and cache) 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!
Note
Callbacks are layer-sensitive, so you most probably want to attach this callback to the βallβ-layer so that it can be triggered independent of the active layer. (e.g. m.all.cb.keypress.attach.fetch_layer()
- Parameters:
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.
verbose (bool) β Indicator if status-messages should be printed or not. The default is True.
Parameters (Additional) β
--------------------- β
key (str, optional) β The key to use for triggering the callback. Modifiers are indicated with a β+β, e.g. βalt+xβ. The default is βxβ.