Skip to content

Commit

Permalink
After review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hansthen committed Feb 26, 2025
1 parent 89d1a0b commit 7723bec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions folium/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ def __init__(
# this attribute is not used by Marker, but by GeoJson
self.icon = None
if icon is not None:
self.add_child(icon)
self.icon = icon
if popup is not None:
self.add_child(popup if isinstance(popup, Popup) else Popup(str(popup)))
Expand All @@ -424,15 +423,11 @@ def _get_self_bounds(self) -> TypeBoundsReturn:
return cast(TypeBoundsReturn, [self.location, self.location])

def render(self):
from .features import CustomIcon, DivIcon

if self.location is None:
raise ValueError(
f"{self._name} location must be assigned when added directly to map."
)
for child in list(self._children.values()):
if isinstance(child, (Icon, CustomIcon, DivIcon)):
self.add_child(self.SetIcon(marker=self, icon=child))
self.add_child(self.SetIcon(marker=self, icon=self.icon))
super().render()


Expand Down

0 comments on commit 7723bec

Please sign in to comment.