Hello,
I have lat/lon pair which I am trying to reverse geocode to get the
city name (or, in Google Maps speak, the SubAdministrativeArea). The
placemark that it returns has an address of something like "Salem, OR
97317, US", and the accuracy level is 5 (which means it should go all
the way down to SubAdministrativeArea), but when I try to access the
SubAdministrativeArea property of the placemark, it gives me
undefined. (I should note that AdministrativeArea and Country do
work.)
Now, the real strange part is that no matter what lat/lon pair I use,
even if it's for a definite house-number level address,
SubAdministrativeArea is _ALWAYS_ undefined. Could someone tell me
what I might be doing wrong? Here is a (simplified) version of my
code:
function reverseGeocode(latlon) {
geocoder = new GClientGeocoder();
geocoder.getLocations(latlon, showAddress);
}
function showAddress(response) {
place = response.Placemark[0];
alert(place.address);
// returns "Salem, OR 97317, US"
alert(place.AddressDetails.Accuracy)
// returns 5
alert
(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName);
// returns undefined
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---