Hi everyone,

I am currently testing the performance of google reverse geocoding
functionality.
I have an xml file containing around 900 lat/long data. I am calling
the geocoder.getLocations() method within the loop. And the callback
function saves the resultant data in an array.

When i display the output of the reverse geocoding, it shows the
result for only few lat/longs. i.e. only for first 29 lat/longs. After
that the output is null for the rest of the lat/longs.

For the lat/long having null result if i try to call the same with
following:

http://maps.google.com/maps/geo?output=xml&oe=utf-8&ll=52.4464,1.72272&keyABQIAAAAGk2_MIxcYdlBpiB3_n2UgxQhzFlfyv47ciBzfnrZRWAuPiCD4hR9Y4wYjfkksXc6nOVB_6qoBlTe8A=&callback=_xdc_._cfmogsn9v

it works great.


This is my code :

//Function to load an xml file and reverse geocode each result

 function ParseMyXML()
    {

     map = new GMap2(document.getElementById
("map_canvas"));map.addControl(new GSmallMapControl());map.addControl
(new GMapTypeControl());


     map.setCenter(new GLatLng(0,0),0);

    bounds = new GLatLngBounds();
    geocoder = new GClientGeocoder(map);
   geocoder.setBaseCountryCode("GB");

   GDownloadUrl("UK1000n.xml", function(data, responseCode) {

            var xml = GXml.parse(data);
            var markers = xml.documentElement.getElementsByTagName
("Location");



             for (var i = 0; i < 900; i++)
             {

           var point = new GLatLng(parseFloat(markers[i].childNodes
(0).text),parseFloat(markers[i].childNodes(1).text));



           var arrmarker = createMarker(point,iconblue);
           bounds.extend(point);
          //Function to reverse goecode
           GetDetails(point);

          }



            });

    }


//Function for reverse geocoding

function GetDetails(latlng) {

      if (latlng) {
      var myHtml ="";

        geocoder.getLocations(latlng, function(addresses) {
          if(addresses.Status.code != 200) {
            myHtml= "no data found";
            //Array for saving the result
            gLocs.push(myHtml);
          }
          else {
            address = addresses.Placemark[0];
            myHtml = address.address;

             //Array for saving the result
            gLocs.push(myHtml);

          }

        });
      }




    }

Please help me out with this. Is it so that too many calls for reverse
geocoding doesnt work properly.

Any help will be appreciated. Pls pls help asap.

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