Record address by coordinates and get in google maps

1

I know that google makes available its api for maps. I would like to record addresses but also the coordinates, that when the user was reading these coordinates, I already showed on his screen or in his App, the map of the searched address. How do I get the coordinates from a given address? Type:

  

Our Lady of Copacabana, 256 - Zip Code: xx.xxx-999

This is just a random address, just an example.

    
asked by anonymous 16.11.2017 / 13:33

1 answer

3

What you want to do is use Geocoding . The way you use it will depend on the language you choose. As you did not specify, a basic example follows in JS.

var geocoder = new google.maps.Geocoder();
geocoder.geocode({
    "address": inputAddress
}, function(results) {
    console.log(results[0].geometry.location); //LatLng
});

If I use .NET, I suggest taking a look at this package that brings a lot of functionality in a very practical way.

It is worth mentioning that geocoding is limited to 2500 requests per day and that according to the terms of use, you should always use it with Google Maps.

    
16.11.2017 / 13:53