-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Seemingly infinite drawing after dropping pin with geocoder plugin #248
Comments
Have you tried to do this without including this code inside a function? def search_area():
m = folium.Map()
Draw().add_to(m)
Geocoder().add_to(m)
st_folium(m,
height=350,
use_container_width=True) Because of the Streamlit execution model, I feel like this re-draws the map every time. Moving the map code outside of a function to the top-level would allow you to interact with the map and keep the various objects. |
Hey Randy, I appreciate your response. The updated code (in a brand new streamlit app): `import folium m = folium.Map() Draw().add_to(m) screen recording of unexpected behavior: |
@randyzwitch I wanted to provide some more context because after re-reading your reply, I feel like I might have not made it clear what the issue is. So if you add either the Draw plugin OR the Geocoder plugin, they operate normally as you would expect. If you add both and DON'T drop a pin using the Geocoder, the Draw tool operates normally. The buggy interaction happens specifically AFTER a pin has been dropped with the Geocoder. I am not familiar enough with Leaflet or Folium but I assume there is some event handler that is not being processed correctly, likely involving the Geocoder. The behavior can be seen in my previously linked video. Thanks for your time, I'm sure you and the team are very busy. |
Apologies if this issue has already been raised and addressed. I looked at the closed issues and didn't see this so I wanted to bring up a bug that I am currently facing. Additionally, this is the first issue I've raised on GitHub so if I leave out any pertinent information let me know and I'll include it.
I am simply trying to enable the dropping of a pin with the Geocoder plugin and then draw a rectangle with the Draw plugin. For the sake of troubleshooting I tried other shapes and the issue seems to exist with those as well. I also tried a handful of different Geocoder providers to no avail.
dependencies:
mvp to reproduce:
steps to reproduce:
On mouse release to end the drawing, the draw tool seems to be getting stuck in a loop where the mouse release triggers the beginning of a new drawing.
The text was updated successfully, but these errors were encountered: