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']
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With