sepal_ui.mapping.menu_control.MenuControl#
- class sepal_ui.mapping.menu_control.MenuControl(**kwargs)[source]#
Widget control displaying a btn on the map.
When clicked the menu expand to show the content set by the user and all the others are closed. It’s used to display interactive tiles directly in the map. If the card_content is a Tile it will be automatically nested.
- Parameters:
icon_content (str) – the icon content as specified in the sm.MapBtn object (i.e. a 3 letter name or an icon name)
card_content (VuetifyWidget | str) – any container from sw. The sw.Tile is specifically design to fit in this component
card_title (str) – the card title. THe tile title will override this parameter if existing
m (Map | None) – The map associated with the Menu
group (Int) – The group of Menu control, tell how the Menucontrol interact with the others
fullscreen (<traitlets.traitlets.Bool object at 0x7f09294c52d0>) – Either or not the Menu container should be displayed in fullscreen on top of the map
Attributes
group
The group of Menu control, tell how the Menucontrol interact with the others
m
the map used to display the control
menu
the menu displayed on the map as a widget
fullscreen
Either or not the Menu container should be displayed in fullscreen on top of the map
Methods
Widget control displaying a btn on the map.
Change the background color of the btn with respect to the status.
Close all the other menus associated to the map to avoid overlapping.
Set the size of the card using all the sizing parameters from a v.Card.
Update the position of the menu if the position of the widget is dynamically changed.
- MenuControl.__init__(icon_content, card_content, card_title='', m=None, group=0, fullscreen=False, **kwargs)[source]#
Widget control displaying a btn on the map.
When clicked the menu expand to show the content set by the user and all the others are closed. It’s used to display interactive tiles directly in the map. If the card_content is a Tile it will be automatically nested.
- Parameters:
icon_content (str) – the icon content as specified in the sm.MapBtn object (i.e. a 3 letter name or an icon name)
card_content (VuetifyWidget | str) – any container from sw. The sw.Tile is specifically design to fit in this component
card_title (str) – the card title. THe tile title will override this parameter if existing
m (Map | None) – The map associated with the Menu
group (int) – The group of Menu control, tell how the Menucontrol interact with the others
fullscreen (bool) – Either or not the Menu container should be displayed in fullscreen on top of the map
- Return type:
None
- MenuControl.activate(*args)[source]#
Change the background color of the btn with respect to the status.
- Return type:
None
- MenuControl.close_others(*args)[source]#
Close all the other menus associated to the map to avoid overlapping.
all the other Menu control from the same group will be closed if this menu is opened. Other MenuCOntrol from other groups can remain open. User will need to be careful with Widget placements on the map.
- Return type:
None
- MenuControl.set_size(min_width='400px', max_width='400px', min_height='40vh', max_height='40vh')[source]#
Set the size of the card using all the sizing parameters from a v.Card.
Default to None for everything if the menu control is fullscreened to avoid css conflict.
- Parameters:
min_width (str | int | None) – a fully qualified css description of the wanted min_width. default to 400px.
max_width (str | int | None) – a fully qualified css description of the wanted max_width. default to 400px.
min_height (str | int | None) – a fully qualified css description of the wanted min_height. default to 40vh.
max_height (str | int | None) – a fully qualified css description of the wanted max_height. default to 40vh.
- Return type:
Self