Response from geocoding API

291

According to the result from the api(https://developers.google.com/maps/documentation/geocoding/intro#GeocodingResponses)

I can write decodedResponse['results'][0]['address_components'][0]['long_name']

The second [0] indicate the location of the type

Share:
291
Michael
Author by

Michael

Updated on December 11, 2022

Comments

  • Michael
    Michael over 1 year

    I'm able to get the fully formatted address from the api,

    "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA"

    for example.

    How do i "breaking to pieces" this formatted address(city, street, country etc)?

    code for getting the fully address -

       final formattedAddress =decodedResponse['results'][0]['formatted_address']