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

Just a question: extract more values based on user click on Draw plugin. #84

Open
leclab0 opened this issue Sep 9, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@leclab0
Copy link

leclab0 commented Sep 9, 2022

Hi, thanks for this great library. Really helpful!

btw I am a beginner in the web developing and github as well, I am so sorry if there are some stupidities on my questions.

I would like to ask, is it possible to return every value of click event?

At the moment, I am trying to present folium map on Streamlit. I used the st_folium with Draw plugin and then utilized some of its return values. However I would like to go further.

For instance, I want user to be able comment on a certain feature or a drawn polygon. For that I created a Popup page that contains a html from. I succeeded to attach the form into the GeojsonPopup however I have struggled to find a way to return the comment and not found it yet. Do you have any idea how to solve it?

Another example regarding clicking event, I would like to get clicking event when a features e.g., a polygon has finished to be created/edited. Is it possible to return a value on that event?

Thank you for you time.

Best wishes,
Leclab Research Assistance,

@randyzwitch randyzwitch added the enhancement New feature or request label Jul 7, 2023
@hansthen
Copy link
Contributor

hansthen commented Nov 14, 2024

In folium v0.18.0 javascript event handlers were added to the Draw plugin. This adds a new on parameter to the Draw plugin with a dictionary of event names and JsCode handlers.

One of the things you can do is call Streamlit.setComponentValue() in one of the events. Have a look at the documentation of the Draw plugin inside the Folium repo and also the realtime page in the streamlit-folium examples for more information on how to do this.

I think this issue can be closed.

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

No branches or pull requests

3 participants