Hello,
I am trying to fetch the geocoded address using the Google Maps API. I
need to fetch the state, street, city and zip code using the API.
When i supply an address I sometimes don't get the City but i get the
street,state etc.
Similarly i dont get the zip returned sometimes.
I am trying to fetch city and street like this:

var area = place.AddressDetails.Country.AdministrativeArea;
state = area.AdministrativeAreaName;
locality = area.SubAdministrativeArea === undefined ?
area.Locality :   area.SubAdministrativeArea.Locality;

                city = locality.LocalityName;
                if (locality.Thoroughfare === undefined) { street =
""; }
                else {
                    street = locality.Thoroughfare.ThoroughfareName;
                }

When i supply an address like "Chestnut Hill Loop, King George, VA " i
don't get the city returned and i get the error message 'locality is
undefined'.
Can someone suggest me how to fetch the city in this case.
If I am wrong somewhr  then let me know.
Thanks
Ripunjay

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to