switch_layerο
- attach.switch_layer(layer, key='x')ο
Set the currently visible layer of the map.
- Parameters:
layer (str or list) β
The layer-name to use (or a list of layer-names to combine).
For details on how to specify layer-names, see
Maps.show_layer()
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β.
Examples
Show layer A:
>>> m.cb.keypress.attach.overlay_layer(layer="A", key="x")
Show layer B with 50% transparency on top of layer A
>>> m.cb.keypress.attach.overlay_layer(layer="A|B{0.5}", key="x")
Show layer B on top of layer A:
>>> m.cb.keypress.attach.overlay_layer(layer=["A", "B"], key="x")
Show layer B with 50% transparency on top of layer A
>>> m.cb.keypress.attach.overlay_layer(layer=["A", ("B", 0.5)], key="x")