Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct type annotations in Realtime #1960

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions folium/plugins/beautify_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(
inner_icon_style="",
spin=False,
number=None,
**kwargs
**kwargs,
):
super().__init__()
self._name = "BeautifyIcon"
Expand All @@ -111,5 +111,5 @@ def __init__(
spin=spin,
isAlphaNumericIcon=number is not None,
text=number,
**kwargs
**kwargs,
)
10 changes: 5 additions & 5 deletions folium/plugins/realtime.py
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
hansthen marked this conversation as resolved.
Show resolved Hide resolved
**kwargs
):
super().__init__()
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
branca>=0.6.0
fiona
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansthen this got merged with this added dependency in the requirements. I don’t think that’s right, since it’s not a required dependency. Could you maybe make a PR to revert this?

jinja2>=2.9
numpy
requests
Expand Down