MCPcopy Create free account
hub / github.com/python-visualization/folium / TreeLayerControl

Class TreeLayerControl

folium/plugins/treelayercontrol.py:10–163  ·  view source on GitHub ↗

Create a Layer Control allowing a tree structure for the layers. See https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree for more information. Parameters ---------- base_tree : dict A dictionary defining the base layers. Valid elements are c

Source from the content-addressed store, hash-verified

8
9
10class TreeLayerControl(JSCSSMixin, MacroElement):
11 """
12 Create a Layer Control allowing a tree structure for the layers.
13 See https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree for more
14 information.
15
16 Parameters
17 ----------
18 base_tree : dict
19 A dictionary defining the base layers.
20 Valid elements are
21
22 children: list
23 Array of child nodes for this node. Each node is a dict that has the same valid elements as base_tree.
24 label: str
25 Text displayed in the tree for this node. It may contain HTML code.
26 layer: Layer
27 The layer itself. This needs to be added to the map.
28 name: str
29 Text displayed in the toggle when control is minimized.
30 If not present, label is used. It makes sense only when
31 namedToggle is true, and with base layers.
32 radioGroup: str, default ''
33 Text to identify different radio button groups.
34 It is used in the name attribute in the radio button.
35 It is used only in the overlays layers (ignored in the base
36 layers), allowing you to have radio buttons instead of checkboxes.
37 See that radio groups cannot be unselected, so create a 'fake'
38 layer (like L.layersGroup([])) if you want to disable it.
39 Default '' (that means checkbox).
40 collapsed: bool, default False
41 Indicate whether this tree node should be collapsed initially,
42 useful for opening large trees partially based on user input or
43 context.
44 selectAllCheckbox: bool or str
45 Displays a checkbox to select/unselect all overlays in the
46 sub-tree. In case of being a <str>, that text will be the title
47 (tooltip). When any overlay in the sub-tree is clicked, the
48 checkbox goes into indeterminate state (a dash in the box).
49 overlay_tree: dict
50 Similar to baseTree, but for overlays.
51 closed_symbol: str, default '+',
52 Symbol displayed on a closed node (that you can click to open).
53 opened_symbol: str, default '-',
54 Symbol displayed on an opened node (that you can click to close).
55 space_symbol: str, default ' ',
56 Symbol between the closed or opened symbol, and the text.
57 selector_back: bool, default False,
58 Flag to indicate if the selector (+ or −) is after the text.
59 named_toggle: bool, default False,
60 Flag to replace the toggle image (box with the layers image) with the
61 'name' of the selected base layer. If the name field is not present in
62 the tree for this layer, label is used. See that you can show a
63 different name when control is collapsed than the one that appears
64 in the tree when it is expanded.
65 collapse_all: str, default '',
66 Text for an entry in control that collapses the tree (baselayers or
67 overlays). If empty, no entry is created.

Callers

nothing calls this directly

Calls 1

TemplateClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…