On Sep 2, 4:56 pm, Chris Mc <[email protected]> wrote:
> Hi,
>
> I've implemented the code here and it works perfectly:
>
> http://code.google.com/apis/maps/documentation/services.html#Geocodin...
>
> what I'm now trying to do is access the other values within
> AddressDetails but I can't seem to get the right code to do that.  On
> some addresses it works (like the ones on the example page), but
> others return no results at all.
>
> I'm guessing that when no results are returned that the full JSON
> string is not being passed back, but I don't know enough about JSON to
> fix it or get it working.
>
> Is this the right way ?
>
> place.address - works in the example, and my code
> place.AddressDetails.Country.CountryNameCode - works in the example,
> and my code
> place.Point.coordinates - works in the example, and my code
>
> But when I try these, they don't always work
>
> place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName
> place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.SubAd­ministrativeAreaName
> place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Local­ity.LocalityName
> place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Local­ity.Thoroughfare.ThoroughfareName
> place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Local­ity.PostalCode.PostalCodeNumber

The geocoder returns inconsistent results (probably due to different
data sources that provide different sets of information). Write your
code to handle the case where the piece of information you are looking
for doesn't exist (make it robust), and it will at least return what
information is available.

  -- Larry
--~--~---------~--~----~------------~-------~--~----~
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