jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.49k stars 364 forks source link

Unable to load layers #1061

Closed moovida closed 2 years ago

moovida commented 2 years ago

Hi, I am having issues adding even simple layers to the Map object in jupyterlab.

I ended up trying the simple marker example from the docs, but that also fails. I am not getting any error, just the broser console shows me something is failing with addLayer:

image

Any idea what is going wrong? Thank you

martinRenou commented 2 years ago

Thanks for opening an issue.

Which ipyleaflet version do you use?

Also can you show us the output of jupyter labextension list?

moovida commented 2 years ago

I am using ipyleaflet 0.17.1

The extensions list shows me:

JupyterLab v3.4.6
~/.local/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyter-leaflet v0.17.1 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.3 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: ~/.local/share/jupyter/lab
        js v0.1.0 enabled OK

Thanks for the fast reply.

martinRenou commented 2 years ago

Do you know what this could be?

Other labextensions (built into JupyterLab)
   app dir: ~/.local/share/jupyter/lab
        js v0.1.0 enabled OK
moovida commented 2 years ago

Yes, (or better, I know why it is there), when I was looking for solutions I found a user saying that after installing that js extension, it worked. I had previously installed the other extensions though.

martinRenou commented 2 years ago

There should be no need for this.

I'd suggest removing entirely the ~/.local/share/jupyter/labextensions and ~/.local/share/jupyter/lab folders, and try again a clean installation with just pip install ipyleaflet.

moovida commented 2 years ago

ok, will try that. Should I install the jupyter-leaflet extension, or is that no longer necessary?

martinRenou commented 2 years ago

Just pip install ipyleaflet is enough, there should be no need to run jupyter labextension install * commands anymore.

moovida commented 2 years ago

And you were right. Reinstalled everything clean and it works perfectly. Not sure when I messed up things now. Thanks a ton.

martinRenou commented 2 years ago

It's really unclear to me as well, the error message you were getting is nothing that I recognize!

Happy that you could get it to work :)