Skip to content

Commit 09c5905

Browse files
Add DivIcon and CustomIcon as accepted type of Marker icon (#2056)
* Add DivIcon as accepted type of Marker icon * Add CustomIcon as accepted type of Marker icon
1 parent d04d4ba commit 09c5905

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

folium/map.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import warnings
77
from collections import OrderedDict
8-
from typing import List, Optional, Sequence, Union
8+
from typing import TYPE_CHECKING, List, Optional, Sequence, Union
99

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

@@ -21,6 +21,9 @@
2121
validate_location,
2222
)
2323

24+
if TYPE_CHECKING:
25+
from folium.features import CustomIcon, DivIcon
26+
2427

2528
class Evented(MacroElement):
2629
"""The base class for Layer and Map
@@ -373,7 +376,7 @@ def __init__(
373376
location: Optional[Sequence[float]] = None,
374377
popup: Union["Popup", str, None] = None,
375378
tooltip: Union["Tooltip", str, None] = None,
376-
icon: Optional[Icon] = None,
379+
icon: Optional[Union[Icon, "CustomIcon", "DivIcon"]] = None,
377380
draggable: bool = False,
378381
**kwargs: TypeJsonValue,
379382
):

0 commit comments

Comments
 (0)