Map.fit_bounds() has no effect on Xeus-Python kernel in JupyterLab 3
See original GitHub issueIt seems like map.fit_bounds()
does not have any effect when run on the Xeus-Python (Python 3.8 (XPython)), but works as expected on the “normal” Python 3 kernel. The same effect can be seen when running in the “normal” mode (not the “simple” one in which the screenshots below were made) and when running as a “classic” notebook (after pressing “Help -> Launch Classic Notebook”).
This took me a while to find out and I’m opening it here first, but I’ve opened one on Xeus kernel as a cross-reference: https://github.com/jupyter-xeus/xeus-python/issues/432. I’m using JupyterLab 3.0.10.
import ipyleaflet
print(ipyleaflet.__version__)
m = ipyleaflet.Map(center=[0, 0], zoom=1)
((s, w), (n, e)) = ((42, -6), (52, 9))
m += ipyleaflet.Polygon(locations=[(s, w), (n, w), (n, e), (s, e)])
# No effect under Xeus-Python (Python 3.8 (XPython)) kernel,
# but as expected under Python 3 kernel:
m.fit_bounds(((s, w), (n, e)))
m
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Map.fit_bounds() has no effect on Xeus-Python ... - GitHub
I'm not sure this is an issue with Xeus-Python, but I've observed it under this kernel only in the context of using ipyleaflet...
Read more >Google maps fitBounds() does not work as expected
I try to zoom to a number of km on a location (Paris, in my case), like this: map.myCircle = circle; // update...
Read more >xeus-python
xeus-python is a Jupyter kernel for Python based on the native implementation of the Jupyter protocol xeus. INSTALLATION.
Read more >Jupyter / IPython: After editing a module, changes are not ...
Jupyter / IPython: After editing a module, changes are not effective without kernel restart · 1) The simplest and most certain is to...
Read more >Visual Debugger for Jupyter Lab - Medium
I will explain how to install and use the visual Jupyter Debugger for Jupyter Labs using the Xeus-python kernel. The prerequisites are:.
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
I think it is because xeus-python doesn’t have event loop integration as ipykernel has. We could also implement
fit_bounds()
using https://github.com/mapbox/mercantile, which would work with all python kernels, but that would only work for Mercator projections. Maybe this is fine.Oh, I thought
fit_bounds
was using comm messages, but it actually doesn’t do that. Then what I said is not valid.