Ok, I've searched endlessly for an answer to this question.

On my Web site when I try to map the address 8287 Key Royal
Lane,Naples,FL,34119 using GClientGeoCoder it fails (using the below
function pasted below), but it works if I enter the address in
maps.google.com
http://maps.google.com/maps?f=q&hl=en&geocode=&q=8287+Key+Royal+Lane,Naples,FL,34119&sll=26.28141,-81.698799&sspn=0.076651,0.127544&ie=UTF8&ll=26.28141,-81.698799&spn=0.076651,0.127544&z=13&iwloc=A

It works fine in maps.google.com but not on my site. Can someone shed
some light on way this may be happening? The only solution I can think
of is to flag addresses in my database that don't work with Google
Maps as "not found" or something and just not show the Map link.
Here's a link to the Web site with the errant address:
http://www.naplesrentals.com/Property/View/?id=726&op=showmap

function showAddress(address) {
            if (GBrowserIsCompatible()) {
                var map = new GMap2(document.getElementById("map"));
                map.enableScrollWheelZoom();
                map.enableDoubleClickZoom();
                map.disableInfoWindow();
                map.addControl(new GSmallZoomControl());
                map.addControl(new GMenuMapTypeControl());
                var geocoder = new GClientGeocoder();
                // ====== Array for decoding the failure codes ======
                var reasons=[];
                reasons[G_GEO_SUCCESS]            = "Success";
                reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The 
address
was either missing or had no value.";
                reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No
corresponding geographic location could be found for the specified
address.";
                reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The
geocode for the given address cannot be returned due to legal or
contractual reasons.";
                reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is 
either
invalid or does not match the domain for which it was given";
                reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily
geocoding quota for this site has been exceeded.";
                reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding
request could not be successfully processed.";

                geocoder.getLocations(address, function (result) {
                    // If that was successful
                    if (result.Status.code == G_GEO_SUCCESS) {
                        // Loop through the results, placing markers
                        var p = result.Placemark[0].Point.coordinates;
                        var marker = new GMarker(new GLatLng(p[1],p[0]));
                        map.setCenter(new GLatLng(p[1],p[0]),14);
                        map.addOverlay(marker);
                        marker.openInfoWindowHtml(address);
                        marker.show();
                        marker.showMapBlowup();
                    } else {
                        var reason="Code "+result.Status.code;
                        if (reasons[result.Status.code]) {
                            reason = reasons[result.Status.code]
                        }
                        alert('Could not find "' + address + '" ' + reason);
                    }
                }
            );
        } else {
            alert("Sorry, the Google Maps API is not compatible with this
browser");
        }
    }

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