Local Weather + Displaying the Address

I am almost ready to submit my challenge, but there is one strange thing happening with the Google Maps API. I used the code var myLocation = json.results[1].formatted_address; to get an address like this: City, Province, Country. This works most of the time, but once in a while, it give me the entire street address which I do not want. Does anybody know why this is happening? I believe there is another place in the JSON that should be for the entire street address.

Okay, thanks. I’ll do it that way. From what I see for my location, there are two formatted_address: in results[0].formatted_address it shows the entire street address, but in results[1].formatted_address it shows just the city, province and country. That was the one I was trying to use.

I used the individual components and got the result I was looking for. Thank you.

Actually, that last solution is not getting consistent results either. Right now I tested it, and got the municipality, the country and part of the postal code. Why does the type of information I’m getting from Google keep changing? Does the setup of the JSON file keep changing?