Let me see if I get (I read your post really fast). You just need to
get the distante and the time without drawing the map.

you can do this in this manner (if you want I can send you an HTML
file that shows what I'm using):


 function initialize() {
      if (GBrowserIsCompatible()) {

        gdir = new GDirections({},
document.getElementById("directions"));

        GEvent.addListener(gdir, "load", onGDirectionsLoad);
        GEvent.addListener(gdir, "error", handleErrors);

        //Get the params by url or Input box
        setDirections(PARAM1,PARAM2 , "en_US");
      }
    }

    function setDirections(fromAddress, toAddress, locale) {
      gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": locale });
    }


    function handleErrors(){
           if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
             alert("No corresponding geographic location could be found for
one of the specified addresses. This may be due to the fact that the
address is relatively new, or it may be incorrect.\nError code: " +
gdir.getStatus().code);
           else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
             alert("A geocoding or directions request could not be
successfully processed, yet the exact reason for the failure is not
known.\n Error code: " + gdir.getStatus().code);

           else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
             alert("The HTTP q parameter was either missing or had no value.
For geocoder requests, this means that an empty address was specified
as input. For directions requests, this means that no query was
specified in the input.\n Error code: " + gdir.getStatus().code);

        //   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  <---
Doc bug... this is either not defined, or Doc is wrong
        //     alert("The geocode for the given address or the route for the
given directions query cannot be returned due to legal or contractual
reasons.\n Error code: " + gdir.getStatus().code);

           else if (gdir.getStatus().code == G_GEO_BAD_KEY)
             alert("The given key is either invalid or does not match the
domain for which it was given. \n Error code: " +
gdir.getStatus().code);

           else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
             alert("A directions request could not be successfully parsed.\n
Error code: " + gdir.getStatus().code);

           else alert("An unknown error occurred.");

        }

      function onGDirectionsLoad(){
      // Use this function to access information about the latest
load()
      // results.

      alert(gdir.getSummaryHtml());
      // document.getElementById("getStatus").innerHTML =
gdir.getStatus().code;

        }


On 11 out, 06:02, "warden [Andrew Leach - Maps API Guru]"
<[EMAIL PROTECTED]> wrote:
> On Oct 11, 5:02 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Had a scroll through these boards and can find lots of info on getting
> > the distance between 2 addresses and passing this into the html to be
> > parsed by the browser, but nothing on getting driving distance using
> > an external script.
>
> http://groups.google.com/group/Google-Maps-API/browse_thread/thread/e...
>
> > Is there any way which the Google API can do this within the TOU? From
> > the TOU I interpret that screen scraping is not allowed so that is not
> > a viable option.
>
> If you use the API, you need to display the data on a public map. If
> you don't use the API, the Maps TOU apply (rather than the API TOU)
> and your use -- which I presume to be internal business use -- is
> apparently allowed. You can get KML output, but not straight 
> XML.http://maps.google.com/maps?saddr=perkins+st+somerville+ma&daddr=330+...
>
> I am not a lawyer. You should satisfy yourself about the legality of
> using a URL like that server-side. I would have recommended including
> the copyright data in your output (even internally), but it doesn't
> appear that the KML includes it.
>
> Andrew

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