0

I'm trying to retrieve data from google geocoding api. I can go response.results but if i try to define it more than that, like response.results.geometry then it's undefined? JSon response from google:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Detroit",
               "short_name" : "Detroit",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Wayne County",
               "short_name" : "Wayne County",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "Michigan",
               "short_name" : "MI",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "USA",
               "short_name" : "US",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Detroit, Michigan, USA",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 42.45023,
                  "lng" : -82.91045099999999
               },
               "southwest" : {
                  "lat" : 42.255192,
                  "lng" : -83.287959
               }
            },
            "location" : {
               "lat" : 42.331427,
               "lng" : -83.0457538
           {........}
J. Doe
  • 571
  • 1
  • 10
  • 24

0 Answers0