-
First of all, I would like to say thank you for this project. It has really broadened my horizons. I am not sure if it is appropriate to ask this question here since it is more related to Streamlit. I have noticed that on the 'Visualize Raster Datasets' page, each time the map is recreated and selected bands is added. Is there a way to save the current map state and add a new layer instead? I have tried using session_state but it doesn't seem to be working. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Unfortunately, that's limitation of folium. Each map is essentially an HTML file. It does not have functionality for adding or removing layers once a map is displayed. It is a one-way street. Once the map is created, it is a done deal. No way back. You might try the st.pydeck_chart. I believe it allows adding/removing layers without recreating the map, but it does not have the rich functionality that leafmap has. |
Beta Was this translation helpful? Give feedback.
Unfortunately, that's limitation of folium. Each map is essentially an HTML file. It does not have functionality for adding or removing layers once a map is displayed. It is a one-way street. Once the map is created, it is a done deal. No way back.
You might try the st.pydeck_chart. I believe it allows adding/removing layers without recreating the map, but it does not have the rich functionality that leafmap has.
https://docs.streamlit.io/library/api-reference/charts/st.pydeck_chart