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

Get lat/lng programmatically from a mouse click event #1402

Closed
giswqs opened this issue Oct 26, 2020 · 1 comment
Closed

Get lat/lng programmatically from a mouse click event #1402

giswqs opened this issue Oct 26, 2020 · 1 comment

Comments

@giswqs
Copy link
Contributor

giswqs commented Oct 26, 2020

Is it possible to get the lat/lng programmatically from a mouse click event on the map? The lat/lng is needed for subsequent computation. Thanks.

@Conengmo
Copy link
Member

Conengmo commented Oct 27, 2020

folium is kind of a one way street from Python to Javascript. So in general, no there's no way to get data made from interacting with the map back to Python. Some ideas:

  • You could have to brew something on your own.
  • You could use the Draw plugin to export a geojson file and load that back into Python.
  • You could take a look at https://github.com/jupyter-widgets/ipyleaflet which should provide more interactivity, though I don't know if they have your use case.

I'm closing this because we're not planning on bringing this functionality to folium.

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

No branches or pull requests

2 participants