Hey,

I've got my map, to map but it is mapping between 10 and 23 of the 33
points I have. In the firebug console window I'm recieving these
messages:

response.Placemark is undefined
[Break on this error]  place = response.Placemark[0];\r\n

on expanding the first one I get this:

addToMap(Object name=Vancouver, , Canada Status=Object)
anonymous(Object name=Vancouver, , Canada Status=Object)
anonymous(Object name=Vancouver, , Canada Status=Object)
geo?output=json&oe=utf-8&q=Vancouver%2C%20%20%2C
%20%20Canada&key=ABQIAAAA5DlOsXhx5QQLPMOOwqbU2RRbHPRyx4R338tPWtgr_ht9D33FIxQ8Nv2ZPTWBF-
B1MSToqBoZy2817Q&mapclient=jsapi&hl=en&callback=_xdc_._og0gx3xnz()

On selecting the last option I receive this in the script window

_xdc_._og0gx3xnz && _xdc_._og0gx3xnz({
"name": "Vancouver, , Canada",
"Status": {
"code": 620,
"request": "geocode"
}
}
)

I read in the google docs that the 620 response error can be caused by
not delaying enough time between points. I tried to resolve this by
putting a 3 second delay between each point being added to the map but
it is still coming up with the same error. I also read processing the
same address could produce this error so I attempted to skip
processing the second point on the map if the last point was the same.
The address that is named as the error changes each time also but it
is usually one of the last addresses that the error displays on.

This is the relevant code I'm attempting to perform this with. I
haven't done a lot of javascript coding before so it might be
something simple. Thanks for any help you can offer.

<body onload="load();">
<?php
                                $increase = 0;
                    while (sqlsrv_fetch( $stmt )) {
                    $Address[] = sqlsrv_get_field( $stmt, 2,
SQLSRV_PHPTYPE_STRING( SQLSRV_ENC_CHAR));
                    $City[] = sqlsrv_get_field( $stmt, 3,
SQLSRV_PHPTYPE_STRING( SQLSRV_ENC_CHAR));
                    $State[] = sqlsrv_get_field( $stmt, 4,
SQLSRV_PHPTYPE_STRING( SQLSRV_ENC_CHAR));
                    $Country[] = sqlsrv_get_field( $stmt, 5,
SQLSRV_PHPTYPE_STRING( SQLSRV_ENC_CHAR));
                    $increase++;
                                }
                                ?>
        <script type="text/javascript">
    //<![CDATA[
   var geocoder;
   var map;
   var point;
   var marker;
   var bounds = new GLatLngBounds();
   var address= '';
   var address2 = '';
// On page load, call this function
   function load()
   {
      // Create new map object
      map = new GMap2(document.getElementById("map"));
      // Create new geocoding object
      geocoder = new GClientGeocoder();
      // Retrieve location information, pass it to addToMap()
        <?php
                while ($increase2 < $increase ) {
        ?>
                address2 = address;
                address = "<?php echo $City[$increase2] . ", ";?> <?php echo 
$State
[$increase2] . ", ";?> <?php echo $Country[$increase2];?>";
                if (address2 != address) {
                        geocoder.getLocations(address, addToMap);
                        }
                <?php
                $increase2++;
                }
                ?>
        }
        function pause(milliseconds) {
        var dt = new Date();
                while
                ((new Date()) - dt <= milliseconds) { }
        }
   function addToMap(response)
   {
          if (response.Status.code != 200) {
                pause(1700);
                }
      // Retrieve the object
      place = response.Placemark[0];
      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);
      bounds.extend(point);
                map.setCenter(bounds.getCenter(), 
map.getBoundsZoomLevel(bounds));
      // Create a marker
      marker = new GMarker(point);
      // Add the marker to map
      map.addOverlay(marker);
          // Add controls and zoom to map
          map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      // Add address information to marker
      //marker.openInfoWindowHtml(place.address);
   }
    //]]>
    </script>
        <?php
        sqlsrv_free_stmt($stmt);
        sqlsrv_close( $conn);
        ?>
<div id="map" />
--~--~---------~--~----~------------~-------~--~----~
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