Skip to content

Commit

Permalink
Add DivIcon and CustomIcon as accepted type of Marker icon (#2056)
Browse files Browse the repository at this point in the history
* Add DivIcon as accepted type of Marker icon

* Add CustomIcon as accepted type of Marker icon
  • Loading branch information
pixelsapphire authored Dec 29, 2024
1 parent d04d4ba commit 09c5905
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 09c5905

Please sign in to comment.