Basil
Basil

Reputation: 11

How to get the name of the region where the marker is placed in Google Maps API, gmaps.js?

i should get name of region by coordinates using Google Maps Api or gmaps.js If you know how do it, please give me answer. And sorry for my english.

Upvotes: 0

Views: 905

Answers (1)

Anand G
Anand G

Reputation: 3210

You need to use the Geocoder service to get location details from coordinates. The response from the Geocoder will contain all the details. All you need is to find out the details you are interested in.

var geocoder = new google.maps.Geocoder();

geocoder.geocode({
    'latLng': latLng
}, function (results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        console.log(results);
    }
});

See this also http://jsfiddle.net/eB2RX/1/

Upvotes: 2

Related Questions