Hello! Can I get the names of the cities on which the user has put markers? You can use Yandex cards.
2 answers
marker.getPosition().lat() marker.getPosition().lng()
also, docks not for people: https://developers.google.com/maps/documentation/javascript/reference?hl=en-RU#LatLng
- About these things I know, I’m interested in getting the names of cities by coordinates: Russia, Belarus, Ukraine - zesen
- Maybe there are normal mysql ready-made tables with cities, so that you can pull them out of coordinates from there - zesen
- I am afraid that if the user will "poke" on the coordinates, then the table should have a large range of coordinates for each city. - VorobyevEvgeniy
- There is a written code for rounding the coordinates to the nearest cities. - zesen
|
var geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { s = results[1].formatted_address; alert(s]); } } else { alert("Geocoder failed due to: " + status); } });
|