File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -403,8 +403,11 @@ def __init__(
403
403
self .options = remove_empty (
404
404
draggable = draggable or None , autoPan = draggable or None , ** kwargs
405
405
)
406
+ # this attribute is not used by Marker, but by GeoJson
407
+ self .icon = None
406
408
if icon is not None :
407
409
self .add_child (icon )
410
+ self .icon = icon
408
411
if popup is not None :
409
412
self .add_child (popup if isinstance (popup , Popup ) else Popup (str (popup )))
410
413
if tooltip is not None :
@@ -421,15 +424,12 @@ def _get_self_bounds(self) -> TypeBoundsReturn:
421
424
return cast (TypeBoundsReturn , [self .location , self .location ])
422
425
423
426
def render (self ):
424
- from .features import CustomIcon , DivIcon
425
-
426
427
if self .location is None :
427
428
raise ValueError (
428
429
f"{ self ._name } location must be assigned when added directly to map."
429
430
)
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 ))
433
433
super ().render ()
434
434
435
435
You can’t perform that action at this time.
0 commit comments