Skip to content

Commit

Permalink
Add tags in GeoJson to support TagFilterButton
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiechoi1995 authored May 4, 2023
1 parent 2f0838d commit f4e4899
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ class GeoJson(Layer):
{% if this.style %}
style: {{ this.get_name() }}_styler,
{%- endif %}
{% if this.tags %}
"tags": {{this.tags}},
{%- endif %}
{%- if this.marker %}
pointToLayer: {{ this.get_name() }}_pointToLayer
{%- endif %}
Expand Down Expand Up @@ -636,6 +639,7 @@ def __init__(
popup: Optional["GeoJsonPopup"] = None,
zoom_on_click: bool = False,
marker: Union[Circle, CircleMarker, Marker, None] = None,
tags: List = None,
):
super().__init__(name=name, overlay=overlay, control=control, show=show)
self._name = "GeoJson"
Expand All @@ -647,6 +651,7 @@ def __init__(
self.style = style_function is not None
self.highlight = highlight_function is not None
self.zoom_on_click = zoom_on_click
self.tags = tags
if marker:
if not isinstance(marker, (Circle, CircleMarker, Marker)):
raise TypeError(
Expand Down

0 comments on commit f4e4899

Please sign in to comment.