You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to generate multiple maps and save them to my system. I noticed that calling m.save() multiple times increases the size of the exported HTML map. Consider the following jupyter notebook
fromipyleafletimportMapforiinrange(20):
m=Map(center=(48.0, 10.0), zoom=5)
m.layout.height="1000px"m.save(f"map_{i}.html", title=f"Map for {i}")
Even though I generate the same map 20 times, the file size differs on my system:
Okay, it seems like jupyter-widgets/ipywidgets#3448 is the underlying issue. The following fix works for me, but I'd like to keep this issue open until ipyleaflet uses the fixed version (once its released)
fromipywidgets.widgets.widgetimportWidgetfromipyleafletimportMapforiinrange(20):
Widget.widgets.clear()
m=Map(center=(48.0, 10.0), zoom=5)
m.layout.height="1000px"m.save(f"bug/map_{i}.html", title=f"Map for {i}")
Hi!
I need to generate multiple maps and save them to my system. I noticed that calling
m.save()
multiple times increases the size of the exported HTML map. Consider the following jupyter notebookEven though I generate the same map 20 times, the file size differs on my system:
Also consider the first and second html page
map_0.txt
map_1.txt
Notice that I am using version
0.17.0
because thesave()
method is broken in version0.17.1
and0.17.2 (newest)
. Any ideas how to resolve this?Best,
René
The text was updated successfully, but these errors were encountered: