Skip to content
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

Fix folium split map bug #2079

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Fix folium split map bug #2079

merged 2 commits into from
Jul 17, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jul 17, 2024

The folium split map control is not working properly. The slider does not swipe the map. Replacing with the folium offical plugin, which apprears to have resolved the issue.

Copy link

github-actions bot commented Jul 17, 2024

@github-actions github-actions bot temporarily deployed to pull request July 17, 2024 01:17 Inactive
@giswqs giswqs merged commit 5a534a7 into master Jul 17, 2024
13 checks passed
@giswqs giswqs deleted the split-map branch July 17, 2024 01:20
@github-actions github-actions bot temporarily deployed to pull request July 17, 2024 01:25 Inactive
@pskoulgi
Copy link

pskoulgi commented Aug 2, 2024

Our Streamlit app built on a fork from your example repo that uses this package recently broke, and I wonder if it might be because of this split_map() change. The offending lines of our app's code are in our repo here and here.

The error inside Streamlit console and on the app page are below, rebooting the app on Streamlit hasn't helped.

I don't understand why the module 'folium.plugins' has no attribute 'SideBySideLayers' error appears, despite reboots (which I presume should pick up latest of both geemap and folium) and the app repo sync'd. Any suggestions would be most helpful! Thanks.

(I checked that the EE authentication token on Streamlit is still fresh, with the same token my local machine is able to run Jupyter notebooks with EE code.)

AttributeError: module 'folium.plugins' has no attribute 'SideBySideLayers'
During handling of the above exception, another exception occurred: 
─────── Traceback (most recent call last) ───────────
  /home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/exec_code.py:75 in exec_func_with_error_handling

/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py:574 in code_to_exec                                      

/mount/src/one-viz/pages/01_Thematic_Map.py:137 in <module>
134 │
135 │   m.to_streamlit(height = 768)
136                                                                         
❱ 137 app()                                                                   
138         
ValueError: module 'folium.plugins' has no attribute 'SideBySideLayers'

image

@giswqs
Copy link
Member Author

giswqs commented Aug 2, 2024

Try updating the folium package.

@pskoulgi
Copy link

pskoulgi commented Aug 3, 2024

I don't know how to explicitly ask Streamlit to update just one of the packages, will try, thanks. I'm a novice at this.

But wouldn't it pull the latest when restarted? Because on restart, it seems to go back to scratch and installs all the necessary packages, according to the repo's requirements file I presume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants