python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.95k stars 2.23k forks source link

Folium Maps fail to load from Malaysia #1582

Closed nabilersyad closed 2 years ago

nabilersyad commented 2 years ago

Describe the bug Any PC in Malaysia connected to the local ISP could will somehow fail or take too long to load any Folium Maps on the browser. I noticed this is a problem only on Malaysian internet connected PCs because when I load the same maps on VPN and changing the region to the US or Singapore, it would load just fine.

To Reproduce

  1. If you are not in Malaysia, use a VPN to change your region to Malaysia
  2. Try loading any Folium Maps. The examples where I encountered this problem are below https://share.streamlit.io/randyzwitch/streamlit-folium/examples/streamlit_app.py https://share.streamlit.io/nabilersyad/train-stations-isochrones/webapp/webapp.py https://www.kaggle.com/code/alexisbcook/interactive-maps
  3. You'll notice that either the maps will take almost a minute to load or the prompt 'Trust this Notebook' will appear
  4. Repeat by changing the region to any other than Malaysia and use try the same maps. You'll notice that the maps load just fine.
  5. Note that if you have already loaded a Folium map in a region outside Malaysia and then switching to Malaysia, you will temporarily still be able to load the map normally.

Expected behavior I expect that Folium Maps would load almost instantly in under 5 seconds.

Environment (please complete the following information):

Additional context

Possible solutions It is possibly a backend or a firewall problem? I'm not really sure.

folium is maintained by volunteers. Can you help making a fix for this issue? I've tried workarounds but none of them work.

Conengmo commented 2 years ago

That is a weird problem. Could you check your browser developer settings, look at the 'network' tab, see what resources are failing to load specifically?

nabilersyad commented 2 years ago

It says several bootstrap files and some analytics js. image image

The console also showed several failed GET requests image

Conengmo commented 2 years ago

Looks like the Bootstrap CDN is not well available in Malaysia. We did switch to a different CDN for those that should be better. This change is now on the main branch and will be included in the upcoming 0.14.0 release. I'll close the issue for now. Please reach out if there are still resources that fail to load going forward.

GreenPatrick2 commented 2 years ago

Hi - great that this is closed. To add a comment, this is not only Malaysia. The MaxCDN is being deprecated worldwide as of January 1st and already we are seeing service degradation. Therefore all customers will soon be impacted, thus some urgency to releasing 0.14.0.

https://www.stackpath.com/blog/maxcdn-and-securecdn-are-retiring-heres-what-it-means-for-you

Conengmo commented 2 years ago

Thanks for the notification! In that case more urgency to release 0.14.0 indeed. Current planning is to do it first week of December.