Skip to content

Commit e7569a5

Browse files
committed
also add customicon and divicon
1 parent b9488ff commit e7569a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

folium/map.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class Marker(MacroElement):
340340
folium.Popup or a folium.Popup instance.
341341
tooltip: str or folium.Tooltip, default None
342342
Display a text when hovering over the object.
343-
icon: Icon plugin
343+
icon: Icon, CustomIcon or DivIcon, optional
344344
the Icon plugin to use to render the marker.
345345
draggable: bool, default False
346346
Set to True to be able to drag the marker around the map.
@@ -418,12 +418,14 @@ def _get_self_bounds(self) -> TypeBoundsReturn:
418418
return cast(TypeBoundsReturn, [self.location, self.location])
419419

420420
def render(self):
421+
from .features import CustomIcon, DivIcon
422+
421423
if self.location is None:
422424
raise ValueError(
423425
f"{self._name} location must be assigned when added directly to map."
424426
)
425427
for child in list(self._children.values()):
426-
if isinstance(child, Icon):
428+
if isinstance(child, (Icon, CustomIcon, DivIcon)):
427429
self.add_child(self.SetIcon(marker=self, icon=child))
428430
super().render()
429431

0 commit comments

Comments
 (0)