Hi,

Does anyone know why my geocoder below gives an error when clicking on
a point that is on the US?

I click anywhere on the map of Mexico and this works well to return
the country code.
When I click on the US I get an error.


My site is http://www.belizemapia.com/index4.html

Register then login then submit and click on the map on US or Europe
for the error.

Function is below.

function showAddress(point) {

var geocoder = new GClientGeocoder();

  geocoder.getLocations(point, function (result) {
    if (result.Status.code == G_GEO_SUCCESS)
    {
      // Loop through the results, looking for the one with Accuracy =
1
      for (var i=0; i<result.Placemark.length; i++)
      {
        var accuracy = result.Placemark[i].AddressDetails.Accuracy;
        if (accuracy == 3) {
          var north = result.Placemark[i].LatLonBox.north;
          var south = result.Placemark[i].LatLonBox.south;
          var east = result.Placemark[i].LatLonBox.east;
          var west = result.Placemark[i].LatLonBox.west;
          var countrybounds = new GLatLngBounds(new GLatLng
(south,west), new GLatLng(north,east));
                            }
          thecountry = result.Placemark
[i].AddressDetails.Country.CountryNameCode;
      }
    }
    else{
      thecountry="00";
      }
    parent.document.getElementById("country_codebx").value =
thecountry;

  });


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