Skip to content

Commit 4f9416f

Browse files
authored
TagFilterButton is not a Layer (#1671)
1 parent ba30a45 commit 4f9416f

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

folium/plugins/tag_filter_button.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
from branca.element import MacroElement
12
from jinja2 import Template
23

34
from folium.elements import JSCSSMixin
4-
from folium.map import Layer
55
from folium.utilities import parse_options
66

77

8-
class TagFilterButton(JSCSSMixin, Layer):
8+
class TagFilterButton(JSCSSMixin, MacroElement):
99
"""
1010
Creates a Tag Filter Button to filter markers based on criteria
1111
(https://github.com/maydemirx/leaflet-tag-filter-button)
@@ -14,8 +14,6 @@ class TagFilterButton(JSCSSMixin, Layer):
1414
----------
1515
data: list, of strings.
1616
The tags to filter for this filter button.
17-
name: string, default None
18-
The name of the Layer, as it will appear in LayerControls.
1917
icon: string, default 'fa-filter'
2018
The icon for the filter button
2119
clear_text: string, default 'clear'
@@ -24,12 +22,6 @@ class TagFilterButton(JSCSSMixin, Layer):
2422
if True, the plugin will filter on every click event on checkbox.
2523
open_popup_on_hover: bool, default False
2624
if True, popup that contains tags will be open at mouse hover time
27-
overlay : bool, default True
28-
Adds the layer as an optional overlay (True) or the base layer (False).
29-
control : bool, default True
30-
Whether the Layer will be included in LayerControls.
31-
show: bool, default True
32-
Whether the layer will be shown on opening (only for overlays).
3325
3426
"""
3527

@@ -71,17 +63,13 @@ class TagFilterButton(JSCSSMixin, Layer):
7163
def __init__(
7264
self,
7365
data,
74-
name=None,
7566
icon="fa-filter",
7667
clear_text="clear",
7768
filter_on_every_click=True,
7869
open_popup_on_hover=False,
79-
overlay=True,
80-
control=True,
81-
show=True,
8270
**kwargs
8371
):
84-
super().__init__(name=name, overlay=overlay, control=control, show=show)
72+
super().__init__()
8573
self._name = "TagFilterButton"
8674
self.options = parse_options(
8775
data=data,

0 commit comments

Comments
 (0)