show_layer

Maps.show_layer(*args, clear=True)

Show a single layer or (transparently) overlay multiple selected layers.

Parameters:

args (str, tuple) –

  • if str: The name of the layer to show.

  • if tuple: A combination of a layer-name and a transparency assignment ( < layer name >, < transparency [0-1] > )

Examples

Show a single layer by providing the name of the layer as string:

>>> m.show_layer("A")

To show multiple layers, use one of the following options:

Provide multiple layer-names (stacking is done from left to right), e.g.:

>>> m.show_layer("A", "B", "C")

Provide the combined layer-name, e.g.:

>>> m.show_layer("A|B|C")

To transparently overlay multiple layers, use one of the following options:

Provide tuples of layer-names and transparency-assignments, e.g.:

>>> m.show_layer("A", ("B", 0.5), ("C", 0.25))

Provide the combined layer-name, e.g.:

>>> m.show_layer("A|B{0.5}|C{0.25}")

See also

Maps.util.layer_selector

Add a button-widget to switch layers to the map.

Maps.util.layer_slider

Add a slider to switch layers to the map.