Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions folium/features.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -1718,7 +1718,6 @@ class DivIcon(MacroElement):
"""
{% macro script(this, kwargs) %}
var {{ this.get_name() }} = L.divIcon({{ this.options|tojavascript }});
{{this._parent.get_name()}}.setIcon({{this.get_name()}});
{% endmacro %}
"""
) # noqa
Expand DownExpand Up@@ -1895,7 +1894,6 @@ class CustomIcon(Icon):
"""
{% macro script(this, kwargs) %}
var {{ this.get_name() }} = L.icon({{ this.options|tojavascript }});
{{ this._parent.get_name() }}.setIcon({{ this.get_name() }});
{% endmacro %}
"""
) # noqa
Expand Down
4 changes: 3 additions & 1 deletion folium/map.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -382,7 +382,9 @@ class SetIcon(MacroElement):
"""
)

def __init__(self, marker: "Marker", icon: "Icon"):
def __init__(
self, marker: "Marker", icon: Union[Icon, "CustomIcon", "DivIcon"]
):
super().__init__()
self._name = "SetIcon"
self.marker = marker
Expand Down