fit_bounds seems to fail when multiple maps/cells are rendered in a notebook
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- jupyter-notebook, python
- Ambito
- data-visualization
Direzione di ricerca
Rinomina il file allegato FitBoundsTest.txt in .ipynb ed eseguilo in Jupyter con più mappe, confrontando l’esecuzione sullo schermo e fuori schermo durante “restart kernel and run all”. Verifica il comportamento di rendering di fit_bounds quando le celle vengono eseguite consecutivamente e quando una cella non riuscita viene eseguita nuovamente. L’attività è completata quando tutte le mappe riprodotte si adattano coerentemente ai propri limiti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Since about September of 2024 I've noticed that folium seems to sometimes fail to correctly "apply" fit_bounds to maps when multiple maps are rendered back-to-back. Manually running map generation cells a second time seems to cause the map to zoom/fit correctly. Have others experienced this?
To Reproduce
[update] I'm happy to report that I now have a concise notebook the reproduces this issue for me consistently.
FitBoundsTest.txt Rename as .ipynb
The issue seems to be related to whether the call to the map rendering function is on or off screen at the time it gets executed. In my browsers, calling "restart kernel and run all" on this notebook causes the notebook to scroll to the start of the last cell where I have some filler_text which fills the screen, yet the last call to test() is barely visible. If I don't scroll during the execution of the cells, once the run is complete, when I do scroll up almost always the first map has not "zoomed" (fit to bounds correctly),
Sometimes the second map is also not "zoomed" correctly, but always the third is. If I remove the filler text (or move it to the top) and restart and run all again, all 3 maps "zoom" correctly. Similarly, if I scroll up to the calls to test() while it is "running all", it also succeeds every time. And, if I manually re-run a single cell that failed to zoom correctly during run all, it then zooms correctly. I hope that helps find and fix the issue. Please let me know how I can be of more assistance.
Expected behavior
All maps correctly fit to bounds as expected.
Environment (please complete the following information):
Current setup, though I've seen it in other settings as well. I believe on windows.
- Browser: Firefox and Chrome
- Jupyter Notebook or html files? Jupyter
- Python version: 3.11.8
- folium version: 0.19.4
- branca version: 0.8.1
Additional context
Never saw this before the end of September 2024, but now see it many places.
Possible solutions
?
folium is maintained by volunteers. Can you help making a fix for this issue?
Maybe
- Lingua principale
- Python
- Stelle
- 7.4k
- Fork
- 2.3k
- Merge medio
- 17h 22m
- PR unite (30g)
- 11
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-visualization/folium
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
python-visualization/folium#2092 · 5 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
python-visualization/folium#2278 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
python-visualization/folium#2236 · 5 commenti · 1 reazione ·
-
Touch Screen often fails Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
python-visualization/folium#2219 · 2 commenti ·
Tutte le issue di python-visualization/folium
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·