Maps with complex polygon layers not rendering in Jupyter Lab/Notebook
See original GitHub issuePlease add a code sample or a nbviewer link, copy-pastable if possible
# Your code here
Problem description
I have been trying to run your sample notebook in examples/Geopandas.ipnyb in both Jupyter Lab and Jupyter Notebook. When I execute the cells, they all execute with no error but no map is rendered. I have had a similar problem in my own notebooks that seems to occur when the polygons are complex and have a lot of data points. I can get it to render simple polygons and so it doesn’t seem to be a library problem. Can you confirm this example still works with the latest release?
Versions below: notebook: 5.2.2 Jupyter Lab: 0.30 (note I upgraded to 0.31 but was having issues getting Lab to load) python: 3.6 Folium: 0.5.0
Expected Output
Rendered map in the examples/Geopandas.ipnyb
Output of folium.__version__
0.5.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:41 (3 by maintainers)
Top Results From Across the Web
Interactive Maps in the Jupyter Notebook
Whats is an interactive map? An interactive map is a web based map with for instance clickable points or zoom functionalities. When clicking...
Read more >ipyleaflet map not rendering in jupyter notebook on install
I received the same error while running Jupyter Notebook but restarting the kernel, and closing and reopening that file worked for me.
Read more >Explore and Visualize Geospatial Data using Leafmap Python ...
The leafmap function add_gdf() is used to load the FAF zone polygon layer. An interactive map is rendered with the drawing tool displayed...
Read more >Getting started — gmaps 0.8.3-dev documentation
Drawing markers, lines and polygons¶. The drawing layer lets you draw complex shapes on the map. You can add markers, lines and polygons...
Read more >Ipyleaflet map object doesn't display in Jupyter Notebook but it ...
This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are two separated issues here:
The former is not in our roadmap! People can try
ipyleaflet
or, if that works, saving thefolium
HTML and seeing if JupyterLab can load it. The reason is b/cfolium
devs have no bandwidth to write a JupyterLab extension (and that was quite te moving target in the past which drove me away from it).For the latter there is a workaround:
I don’t know the details of why everything works in all the browsers I tested but Chrome so I’m closing this as “won’t fix.” (PRs are still welcome though 😉)
In the meantime, others encountering this issue can workaround the problem by using the following monkey patch, which works for
folium==0.10.0
andbranca==0.3.1
. This code would have to be executed before usingfolium
(e.g., in an early cell of a Jupyter notebook).