Open Dubaja opened 2 years ago
You can use the .save('output.html')
method on the map
You can use the
.save('output.html')
method on the map
I know, but i dont need to save it, i need to store it in a variable.
Leafmap has a to_html()
for that.
https://leafmap.org/leafmap/#leafmap.leafmap.Map.to_html
import leafmap
m = leafmap.Map()
html = m.to_html()
@giswqs it'd be great if you could contribute back if you managed to add it!
@martinRenou Ha, the leafmap.Map.to_html()
function actually uses ipyleaflet.save()
, read the html into a string, and delete the HTML file. It is probably not that useful to add to ipylealfet.
One potential improvement is to allow outfile=None
that can return the HTML string, i.e., generate the HTML file, reads it into a string, then delete the HTML file. I can submit a PR you think it is a good idea.
Is there a method like
_repr_html_()
in folium, which returns the map in HTML form? If not can it be implemented?