Folium/leaflet maps not loading or taking too long to load

I made an application using folium maps and specifically using the streamlit_folium component to render my maps.
I’ve noticed for a couple of months now that the maps will often take too long to render(around 1 minute) and sometimes not render at all. (shows the message ‘Make this Notebook Truste to load map’)
What’s baffling is that this problem happens to apps that I didn’t create, apps that I host on Streamlit Cloud and apps that I run locally. But somehow this problem doesn’t occur in one of the laptops that I have.
Any idea what’s going on and if anyone else has encountered it.

Leaving some links to where I encountered this problem. My application and the streamlit_folium demo app

Hi @nabilersyad, welcome to the Streamlit community!

What browser/OS are you trying to view from? The streamlit-folium app loads for me in about a second in Chrome, and your train app loads quickly as well.


Hi Randy, thanks for reply and for creating the component!

I’ve tried it on my custom PC that I dualboot Linux and Windows. Both OS take time to load on Chrome, Mozilla, Edge and Brave. I’ve also tested it on my 2015 Macbook Air. using Chrome and Safari. Same issue.

The only place that works fine is my Lenovo X1 work laptop running on Windows and Chrome. So i’m really not sure what’s the problem on my end.

So I’ve discovered that it might be due to my country’s internet (Malaysia) that is somehow preventing Folium maps from being rendered properly. I connected to a VPN, changed my location to Singapore, Canada and USA. They all worked properly. I don’t know the solution to this or if anyone has encountered this kind of situation before. Would appreciate any advice.

1 Like