Closed
Description
I’m working with Folium and generating a map saved as a local HTML file using save(). I’d like to add functionality where each marker in the popup has a delete button (such as a trash icon) that allows the user to remove the marker from the map permanently. Something like this for the trash icon:
html = f"""<div><a href="#" class="delete-marker" data-marker-id="{marker_id}" title="Remove this marker">
<i class="fa fa-trash"></i>
</a></div>"""
marker = folium.Marker(location=[lat, lon], popup=html, ...)
However, I’m not sure how to implement the functionality to actually remove the marker from the map after the button is clicked, especially when working with a static, locally saved HTML file. Is there a way to achieve this with Folium, or would I need to implement custom JavaScript for this behavior?
Metadata
Metadata
Assignees
Labels
No labels