fit_bounds seems to fail when multiple maps/cells are rendered in a notebook
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- jupyter-notebook, python
- Área
- data-visualization
Línea de trabajo
Cambie el nombre del archivo adjunto FitBoundsTest.txt a .ipynb y ejecútelo en Jupyter con varios mapas, comparando la ejecución en pantalla y fuera de pantalla durante “restart kernel and run all”. Compruebe el comportamiento de renderizado de fit_bounds cuando las celdas se ejecutan consecutivamente y cuando se vuelve a ejecutar una celda fallida. Se considera terminado cuando todos los mapas reproducidos se ajustan sistemáticamente a sus límites.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 7.4k
- Forks
- 2.3k
- Merge medio
- 17 h 22 min
- PR fusionados (30 d)
- 11
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-visualization/folium
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
python-visualization/folium#2092 · 5 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
python-visualization/folium#2278 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
python-visualization/folium#2236 · 5 comentarios · 1 reacción ·
-
Touch Screen often fails Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
python-visualization/folium#2219 · 2 comentarios ·
Todos los issues de python-visualization/folium
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
canonical/paas-charm#368 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
addition to tracking list Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
StevenBlack/hosts#3256 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
qualcomm/qai-appbuilder#275 ·