I am trying to find directions using the GDirections API. It works
fine for most of US states but once it comes to other regions
(especially UAE)  Google Map API returns us the following error
Message.

---------------------------
Failed to obtain directions, Code 604 : The GDirections object could
not compute directions between the points.
---------------------------

Following is the Code that i am using.

----------------------------------

    var x1 = '25.176024';
        var y1 = '55.2445935';
        var x2 = '25.276024';
        var y2 = '55.3445935';


        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.";
        reasons[G_GEO_BAD_REQUEST] = "A directions request could not
be successfully parsed.";
        reasons[G_GEO_MISSING_QUERY] = "No query was specified in the
input.";
        reasons[G_GEO_UNKNOWN_DIRECTIONS] = "The GDirections object
could not compute directions between the points.";


        var map = new GMap(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(x1, y1), 10);

        var gdir = new GDirections(null, document.getElementById
("path"));

        GEvent.addListener(gdir, "error", function() {
            var code = gdir.getStatus().code;
            var reason = "Code " + code;
            if (reasons[code]) {
                reason = "Code " + code + " : " + reasons[code]
            }
            alert("Failed to obtain directions, " + reason);
        });
        var poly;
        GEvent.addListener(gdir, "load", function() {
            if (poly) map.removeOverlay(poly);
            poly = gdir.getPolyline();
            map.addOverlay(poly);
        });
        gdir.load("from: " + x1 + "," + y1 + " to: " + x2 + "," + y2 +
"", { getPolyline: true });

----------------------------------

Could someone explain where it is going wrong?

Thanks in advice...

--

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=.


Reply via email to