Draw plugin can save a geoJson file with the objects put on the map. But if I add a marker programmatically or the map already has markers, I lose them, they are not included when draw plugin exports the data into the GeoJson file.
On the other hand, avoiding draw plugin, I made markers with 'ClickForMarker' on an existing map w/markers and then saved the map, but I lose the new markers; they are not present in the HTML, just the original ones (programmatically generated).
Finally, the idea is to find a way to, having a base map with markers, add some new ones, and save (or export) the whole thing.
from folium.plugins import Draw
m = folium.Map(location=[52.1, 5.1], zoom_start=12)
draw.add_to(m)
draw = Draw(
export=True,
filename='data.geojson',
position='topleft',
draw_options={'polyline': {'allowIntersection': False}},
edit_options={'poly': {'allowIntersection': False}}
)
folium.Marker((52.0, 5.0), tooltip='both', icon=icon_red).add_to(m)
m