Skip to content

Commit 7723bec

Browse files
committed
After review comments
1 parent 89d1a0b commit 7723bec

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

folium/map.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ def __init__(
406406
# this attribute is not used by Marker, but by GeoJson
407407
self.icon = None
408408
if icon is not None:
409-
self.add_child(icon)
410409
self.icon = icon
411410
if popup is not None:
412411
self.add_child(popup if isinstance(popup, Popup) else Popup(str(popup)))
@@ -424,15 +423,11 @@ def _get_self_bounds(self) -> TypeBoundsReturn:
424423
return cast(TypeBoundsReturn, [self.location, self.location])
425424

426425
def render(self):
427-
from .features import CustomIcon, DivIcon
428-
429426
if self.location is None:
430427
raise ValueError(
431428
f"{self._name} location must be assigned when added directly to map."
432429
)
433-
for child in list(self._children.values()):
434-
if isinstance(child, (Icon, CustomIcon, DivIcon)):
435-
self.add_child(self.SetIcon(marker=self, icon=child))
430+
self.add_child(self.SetIcon(marker=self, icon=self.icon))
436431
super().render()
437432

438433

0 commit comments

Comments
 (0)