Skip to content

Commit f4e4899

Browse files
Add tags in GeoJson to support TagFilterButton
1 parent 2f0838d commit f4e4899

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

folium/features.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ class GeoJson(Layer):
601601
{% if this.style %}
602602
style: {{ this.get_name() }}_styler,
603603
{%- endif %}
604+
{% if this.tags %}
605+
"tags": {{this.tags}},
606+
{%- endif %}
604607
{%- if this.marker %}
605608
pointToLayer: {{ this.get_name() }}_pointToLayer
606609
{%- endif %}
@@ -636,6 +639,7 @@ def __init__(
636639
popup: Optional["GeoJsonPopup"] = None,
637640
zoom_on_click: bool = False,
638641
marker: Union[Circle, CircleMarker, Marker, None] = None,
642+
tags: List = None,
639643
):
640644
super().__init__(name=name, overlay=overlay, control=control, show=show)
641645
self._name = "GeoJson"
@@ -647,6 +651,7 @@ def __init__(
647651
self.style = style_function is not None
648652
self.highlight = highlight_function is not None
649653
self.zoom_on_click = zoom_on_click
654+
self.tags = tags
650655
if marker:
651656
if not isinstance(marker, (Circle, CircleMarker, Marker)):
652657
raise TypeError(

0 commit comments

Comments
 (0)