opengeos / streamlit-geospatial

A multi-page streamlit app for geospatial
https://huggingface.co/spaces/giswqs/Streamlit
MIT License
883 stars 396 forks source link

geemap Map's layers in streamlit #102

Closed MuhammedM294 closed 1 year ago

MuhammedM294 commented 1 year ago

Recently, the map layers don't show in the app. The map frames and controls are okay, but the layers have a problem. I tried to install previous versions of geemap and leafmap, but still have the same issue.

giswqs commented 1 year ago

Try out https://geospatial.streamlit.app/Earth_Engine_Datasets. It works fine.

MuhammedM294 commented 1 year ago

Thank you for your reply! The problem with the basemap itself not just the gee layers. I've tested it in jupyter notebook and it works fine, but within streamlit, either locally or on the cloud doesn't work.

giswqs commented 1 year ago

Share the link to your source code? Otherwise, there is nothing I can do about it as I can't reproduce the issue

MuhammedM294 commented 1 year ago

Just to make everything clear. I developed a package (iteru) in which I inherited the Map class from geemap. Here is the link for that: https://github.com/MuhammedM294/Iteru/blob/main/iteru/map.py#L14

Then, in the streamlit app package (iteruapp), I imported that class here to serve for the interactive mapping: https://github.com/MuhammedM294/IteruApp/blob/master/apps/timelapse.py#L23

and please find here the app link: https://share.streamlit.io/muhammedm294/iteruapp

giswqs commented 1 year ago

Did you try out the geemap.Map() class directly with streamlit? If geemap.Map() works with streamlit but not your own inherited map class, then it is your package issue rather than a geemap issue.

giswqs commented 1 year ago

It appears that you are using the ipyleaflet plotting backend. You should use folium instead. Ipyleaflet does not work well with streamlit

MuhammedM294 commented 1 year ago

Solved Thanks!