diff --git a/folium/plugins/beautify_icon.py b/folium/plugins/beautify_icon.py index d45e9eb58..99a8e1e6c 100644 --- a/folium/plugins/beautify_icon.py +++ b/folium/plugins/beautify_icon.py @@ -95,7 +95,7 @@ def __init__( inner_icon_style="", spin=False, number=None, - **kwargs + **kwargs, ): super().__init__() self._name = "BeautifyIcon" @@ -111,5 +111,5 @@ def __init__( spin=spin, isAlphaNumericIcon=number is not None, text=number, - **kwargs + **kwargs, ) diff --git a/folium/plugins/realtime.py b/folium/plugins/realtime.py index d7f99594d..7944e3fe1 100644 --- a/folium/plugins/realtime.py +++ b/folium/plugins/realtime.py @@ -1,14 +1,14 @@ from typing import Optional, Union -from branca.element import MacroElement from jinja2 import Template from folium.elements import JSCSSMixin -from folium.map import Layer +from folium.features import GeoJson +from folium.map import FeatureGroup from folium.utilities import JsCode, camelize, parse_options -class Realtime(JSCSSMixin, MacroElement): +class Realtime(JSCSSMixin, FeatureGroup): """Put realtime data on a Leaflet map: live tracking GPS units, sensor data or just about anything. @@ -42,7 +42,7 @@ class Realtime(JSCSSMixin, MacroElement): remove_missing: bool, default False Should missing features between updates been automatically removed from the layer - container: Layer, default GeoJson + container: FeatureGroup or GeoJson, default GeoJson The container will typically be a `FeatureGroup`, `MarkerCluster` or `GeoJson`, but it can be anything that generates a javascript L.LayerGroup object, i.e. something that has the methods @@ -109,7 +109,7 @@ def __init__( get_feature_id: Union[JsCode, str, None] = None, update_feature: Union[JsCode, str, None] = None, remove_missing: bool = False, - container: Optional[Layer] = None, + container: Optional[Union[FeatureGroup, GeoJson]] = None, **kwargs ): super().__init__() diff --git a/requirements.txt b/requirements.txt index dff8e41f4..bebfd7dae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ branca>=0.6.0 +fiona jinja2>=2.9 numpy requests