Leaflet or ipyleaflet?

I’m looking for someone who can help to get Leaflet.js working in Anvil. There is a library called ipyleaflet in PyPI that works with Jupyter, but I’m not savvy enough to have a clue how to use Leaflet in Anvil for mapping.

Can anyone help? Thank you!
Vic

Have you tried using the Folium library which provides a Python API to Leaflet.js? It is a really fantastic library. I build the maps in Jupyter, and when I want to share them, I just save them as an HTML file. If you want to use that saved map in Anvil, you can display it in an iframe.

Here is a link to a clone that demonstrates displaying a Folium/Leaflet.js map inside of Anvil:

1 Like

Thank you. I’ll try it. Does it support Leaflet’s drawing functions and callbacks?

Vic

Check out the Folium docs and their many example notebooks to see if they have the Leaflet functionality you require.

https://python-visualization.github.io/folium/