D
D
Dave2016-12-06 13:41:59
JavaScript
Dave, 2016-12-06 13:41:59

How to get the name of the region when clicking on the map?

There is such a site . When you click on "Select on the map", and on subsequent selection, the value is caught and substituted into the corresponding input.
I can not find this moment - how to catch (or where is transmitted) the selected value of the card? Interested in a solution either with Yandex Map or with Google Maps

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-12-06
@djay

For google:
Connect the map to the project, catch a click on it - example
Then pass the obtained position (lat, lon) to a service such as the Google Maps Geocoding API
, it will return the name of the place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question