File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -403,8 +403,11 @@ def __init__(
403403 self .options = remove_empty (
404404 draggable = draggable or None , autoPan = draggable or None , ** kwargs
405405 )
406+ # this attribute is not used by Marker, but by GeoJson
407+ self .icon = None
406408 if icon is not None :
407409 self .add_child (icon )
410+ self .icon = icon
408411 if popup is not None :
409412 self .add_child (popup if isinstance (popup , Popup ) else Popup (str (popup )))
410413 if tooltip is not None :
@@ -421,15 +424,12 @@ def _get_self_bounds(self) -> TypeBoundsReturn:
421424 return cast (TypeBoundsReturn , [self .location , self .location ])
422425
423426 def render (self ):
424- from .features import CustomIcon , DivIcon
425-
426427 if self .location is None :
427428 raise ValueError (
428429 f"{ self ._name } location must be assigned when added directly to map."
429430 )
430- for child in list (self ._children .values ()):
431- if isinstance (child , (Icon , CustomIcon , DivIcon )):
432- self .add_child (self .SetIcon (marker = self , icon = child ))
431+ if self .icon :
432+ self .add_child (self .SetIcon (marker = self , icon = self .icon ))
433433 super ().render ()
434434
435435
You can’t perform that action at this time.
0 commit comments