1
+ from branca .element import MacroElement
1
2
from jinja2 import Template
2
3
3
4
from folium .elements import JSCSSMixin
4
- from folium .map import Layer
5
5
from folium .utilities import parse_options
6
6
7
7
8
- class TagFilterButton (JSCSSMixin , Layer ):
8
+ class TagFilterButton (JSCSSMixin , MacroElement ):
9
9
"""
10
10
Creates a Tag Filter Button to filter markers based on criteria
11
11
(https://github.com/maydemirx/leaflet-tag-filter-button)
@@ -14,8 +14,6 @@ class TagFilterButton(JSCSSMixin, Layer):
14
14
----------
15
15
data: list, of strings.
16
16
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.
19
17
icon: string, default 'fa-filter'
20
18
The icon for the filter button
21
19
clear_text: string, default 'clear'
@@ -24,12 +22,6 @@ class TagFilterButton(JSCSSMixin, Layer):
24
22
if True, the plugin will filter on every click event on checkbox.
25
23
open_popup_on_hover: bool, default False
26
24
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).
33
25
34
26
"""
35
27
@@ -71,17 +63,13 @@ class TagFilterButton(JSCSSMixin, Layer):
71
63
def __init__ (
72
64
self ,
73
65
data ,
74
- name = None ,
75
66
icon = "fa-filter" ,
76
67
clear_text = "clear" ,
77
68
filter_on_every_click = True ,
78
69
open_popup_on_hover = False ,
79
- overlay = True ,
80
- control = True ,
81
- show = True ,
82
70
** kwargs
83
71
):
84
- super ().__init__ (name = name , overlay = overlay , control = control , show = show )
72
+ super ().__init__ ()
85
73
self ._name = "TagFilterButton"
86
74
self .options = parse_options (
87
75
data = data ,
0 commit comments