Home    Articles


Google Autocomplete how to get GPS coordinates for place or address


If you are trying to get GPS coordinates of some address that you've founded in the Autocomplete script, here is how you get them:

1. Take this google example:


2. Find the function and edit: 

Find this function: fillInAddress and add these lines: 

// [START region_fillform]
function fillInAddress() {
  // Get the place details from the autocomplete object.
  var place = autocomplete.getPlace();
  // this will show you in console the coordinates

The GPS coordinates are there, you just need to know to find them.

UPDATE: Google has updated this API so you should take a look at features and deprechated things.