6

I can't understand if I can obtain coordinates with a google places autocomplete response. Or do I have to make an explicit request to google maps with formatted address coming from the google places response?

user1518217
  • 574
  • 1
  • 8
  • 20

3 Answers3

2

I'm making two calls one to get the coordinates and fetch the place details using that. I hope there is no way to do that alone.

saif
  • 1,182
  • 14
  • 27
2

You can parse the response object: Result.geometry.location.

Here is a detailed explanation on the the places response object: Place Details Responses

Franco Vizcarra
  • 428
  • 2
  • 11
2

you can retrive predictions programaticly using AutocompleteService Class with the getPlacePredictions() method [1] to retrive place_id [2]. then with this place_id you can use the Places Details Service [3] to get coordinates and more details of the place.

[1] https://developers.google.com/maps/documentation/javascript/places-autocomplete

[2]https://developers.google.com/maps/documentation/javascript/reference#AutocompletePrediction

[3] https://developers.google.com/maps/documentation/javascript/places#place_details

betofarina
  • 1,066
  • 7
  • 9