diff --git a/folium/plugins/realtime.py b/folium/plugins/realtime.py index d7f99594d..515b70194 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. @@ -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__()