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

Add DivIcon and CustomIcon as accepted type of Marker icon #2056

Merged
merged 2 commits into from
Dec 29, 2024
Merged
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
7 changes: 5 additions & 2 deletions folium/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import warnings
from collections import OrderedDict
from typing import List, Optional, Sequence, Union
from typing import TYPE_CHECKING, List, Optional, Sequence, Union

from branca.element import Element, Figure, Html, MacroElement

Expand All @@ -21,6 +21,9 @@
validate_location,
)

if TYPE_CHECKING:
from folium.features import CustomIcon, DivIcon


class Evented(MacroElement):
"""The base class for Layer and Map
Expand Down Expand Up @@ -373,7 +376,7 @@ def __init__(
location: Optional[Sequence[float]] = None,
popup: Union["Popup", str, None] = None,
tooltip: Union["Tooltip", str, None] = None,
icon: Optional[Icon] = None,
icon: Optional[Union[Icon, "CustomIcon", "DivIcon"]] = None,
draggable: bool = False,
**kwargs: TypeJsonValue,
):
Expand Down
Loading