-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map not displayed when using ipyleaflet
but works for folium
#2069
Comments
This is always an ipylealfet installation issue. Try creating a fresh conda env to install geemap. conda create -n gee python=3.11
conda activate gee
conda install geemap -c conda-forge |
@giswqs I am asking this because many times we need other packages in a project and it doesn't seem ideal to to create a separate environment just for gee. Also: Any suggestions? |
This is quite a common issue that comes up from time to time. Try the following. If it does not work, then it is an ipyleaflet installation issue. Creating a fresh con env usually should resolves the issue. If it does not, then it is probably because your jupyter environment has some restrictions that prevents the leaflet JS compoents from being loaded properly. If this is the case, you can report it to the ipyleaflet repo. import ipyleaflet
m = ipyleaflet.Map()
m Relevant issues: |
Thanks for the quick response. Why it doesn't happen with folium? 🤔 I tried what is suggested in the documentation. I installed then jupyter lab build
jupyter labextension install jupyter-leaflet When I do jupyter labextension list it returns JupyterLab v4.1.6
/home/iury/miniforge3/share/jupyter/labextensions
jupyter-leaflet v0.19.1 enabled OK
jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
jupyterlab-quarto v0.2.8 enabled OK (python, jupyterlab-quarto)
@jupyter-widgets/jupyterlab-manager v5.0.11 enabled OK (python, jupyterlab_widgets)
@pyviz/jupyterlab_pyviz v3.0.0 enabled OK
Other labextensions (built into JupyterLab)
app dir: /home/iury/miniforge3/share/jupyter/lab Even with all of this, I receive the following error when trying to load the map. [Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'LeafletMapModel' from module 'jupyter-leaflet'
Error: Module jupyter-leaflet, version ^0.18 is not registered, however, 0.19.1 is
at f.loadClass (http://localhost:10000/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:75041)
at f.loadModelClass (http://localhost:10000/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:11349)
at f._make_model (http://localhost:10000/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:9237)
at f.new_model (http://localhost:10000/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:6734)
at f.handle_comm_open (http://localhost:10000/static/lab/4416.74698273b3de2ad84746.js?v=74698273b3de2ad84746:1:5425)
at _handleCommOpen (http://localhost:10000/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:73457)
at C._handleCommOpen (http://localhost:10000/static/lab/jlab_core.1c88bfbd428297518bc8.js?v=1c88bfbd428297518bc8:1:1335202)
at async C._handleMessage (http://localhost:10000/static/lab/jlab_core.1c88bfbd428297518bc8.js?v=1c88bfbd428297518bc8:1:1337192) Which is funny, as it complains that ^0.18 is not registered, but admits that v0.19.1 is. I checked and, in fact, there are no 0.18 versions for
returns
I tried to downgrade to I tried to redo everything I did for the |
I think I found something. I tried to install
Now the problem also occurs for the base environment. If I now upgrade ipyleaflet
returns
Which downgrades geemap to 0.32.0. and now it came back working for the base environment. It turns out that I just needed to install |
Environment Information
Description
returns
Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…
instead of the map.
The same doesn't occur if I use
folium
The text was updated successfully, but these errors were encountered: