Is it possible to get the coordinate where a user clicks in the map? #633
-
I'd like to be able to get the coordinate of a user's click in the map, no matter if there is a feature on the map there or not. I've attached a simple function the map's .observe() which prints the change, and it fires when I pan/zoom, but I'm not seeing anything come across when I click on the map. Is there a way to get a coordinate back from a click in the map? if not is there a plan to add such functionality? I imagine if it doesn't currently exist that it would require some javascript to get, which isn't my native language, but I'd love to try to help out to make it possible. I've been truly impressed with my lonboarding thus far, keep up the great work everyone! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is not currently possible. We don't expose an The JS side exposes the screen coordinate clicked, and then we'd have to map back to geospatial coordinate for the user. If you're interested in contributing this, I can point you to how it could be implemented. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
This is not currently possible. We don't expose an
on_click
handler, though we could.The JS side exposes the screen coordinate clicked, and then we'd have to map back to geospatial coordinate for the user.
If you're interested in contributing this, I can point you to how it could be implemented.