pysepal.mapping.layers_control.ToggleRow#
- class pysepal.mapping.layers_control.ToggleRow(*args, **kwargs)[source]#
Html row element to describe a layer exposing no visibility trait.
Layers such as the ipyleaflet
PMTilesLayerinherit fromLayerrather thanRasterLayer, so they have neithervisiblenoropacityto link a widget to. They are hidden by removing them from the map instead, which means the control has to remember them, and where they sat, to keep the row in place.Showing a layer again appends it to the map, so it lands on top of anything added while it was hidden. That cannot be undone from python: ipywidgets reuses the views of the models already present, so reordering
m.layersnever replays leaflet’saddLayerand the stack stays as it is.- Parameters:
layer (Layer) – the layer associated to the row
control (LayersControl) – the layer control owning the registry of hidden layers
index (int) – the position of the row, restored as is when the layer is hidden
Attributes
w_checkboxthe checkbox to hide/show the layer
Methods
Html row element to describe a layer exposing no visibility trait.
- ToggleRow.__init__(layer, control, index)[source]#
Html row element to describe a layer exposing no visibility trait.
Layers such as the ipyleaflet
PMTilesLayerinherit fromLayerrather thanRasterLayer, so they have neithervisiblenoropacityto link a widget to. They are hidden by removing them from the map instead, which means the control has to remember them, and where they sat, to keep the row in place.Showing a layer again appends it to the map, so it lands on top of anything added while it was hidden. That cannot be undone from python: ipywidgets reuses the views of the models already present, so reordering
m.layersnever replays leaflet’saddLayerand the stack stays as it is.- Parameters:
layer (Layer) – the layer associated to the row
control (LayersControl) – the layer control owning the registry of hidden layers
index (int) – the position of the row, restored as is when the layer is hidden
- Return type:
None