peek_layerο
- click_callbacks.peek_layer(layer='1', how=(0.4, 0.4), alpha=1, **kwargs)ο
Swipe between data- or WebMap layers or peek a layers through a rectangle.
- Parameters
layer (str or list) β
if str: The name of the layer you want to peek at.
if list: A list of layer-names to peek at. (alternatively you can also separate individual layer-names with a β|β character, e.g.: βlayer1|layer2β)
how (str , float or tuple, optional) β
The method you want to visualize the second layer. (e.g. swipe from a side or display a rectangle)
βleftβ (β), βrightβ (β), βtopβ (β), βbottomβ (β): swipe the layer at the mouse-position.
βfullβ: overlay the layer on the whole figure
if float: peek a square at the mouse-position, specified as percentage of the axis-width (0-1)
if tuple: (width, height) peek a rectangle at the mouse-position, specified as percentage of the axis-size (0-1)
The default is βleftβ.
alpha (float, optional) β The transparency of the peeked layer. (must be between 0 and 1) The default is 1.
**kwargs β additional kwargs passed to a rectangle-marker. the default is (fc=βnoneβ, ec=βkβ, lw=1)
Note
You must draw something on the layer first!
To assign a layer to an object, either use the layer=β¦ argument when adding objects (e.g. m.plot_map(layer=1)), or use a new Maps-layer via
>>> m = Maps() >>> m2 = m.new_layer(layer="the layer name") >>> # now all artists added with m2 will be added to the layer >>> # "the layer name" (if not explicitly specified otherwise) >>> m2.plot_map() >>> m.peek_layer(layer="the layer name")