Mike,

I got it!  Finally!

You were on the right path when you suggested setDirections("44512", "", "",
"", "955 Windham Court, Boardman OH 44512", "en_US");.  Instead, since
everything gets loaded from the HTML in hidden fields, I just tossed out the
entire line altogether.  It now works, without errors, perfectly.

Because the site that I have been referencing is not going to be there
forever, here's the code for anyone looking to do this.

I now have the setDirections function as follows:

    function setDirections(fromStreet, fromCity, fromState, fromZipcode,
toAddress, locale) {
      gdir.load("from: " + fromStreet + ", " + fromCity + ", " + fromState +
"  " + fromZipcode + " " + " to: " + toAddress,
                { "locale": locale , "getSteps":true});
    }

In the webpage the <form> tag must include an onsubmit entry that says the
following:

onsubmit="setDirections(this.fromStreet.value, this.fromCity.value,
this.fromState.value, this.fromZipcode.value, this.to.value,
this.locale.value); return false"

And then in the form itself, you would need the following:

    <input type="text" id="fromStreet" name="fromStreet" value=""
style="width: 190px;background-color:#ffffff;border:0px"/>
    <input type="text" id="fromCity" name="fromCity" value="" style="width:
190px;background-color:#ffffff;border:0px"/>
    <input type="text" id="fromState" name="fromState" value=""
style="width: 190px;background-color:#ffffff;border:0px"/>
    <input type="text" id="fromZipcode" name="fromZipcode" value=""
style="width: 190px;background-color:#ffffff;border:0px"/>
    <input type="text" style="display:none" id="fromAddress" name="from" />
    <input type="text" style="display:none" id="toAddress" name="to"
value="955 Windham Court, Boardman OH 44512"/>

where line 6's value the the to: address.

This can now easily be modified to allow for both a FROM: and a TO: location
with just a few edits.

Thanks to Mike for lending his brilliance!
-Kyle

On Tue, Dec 16, 2008 at 3:38 PM, Kyle <[email protected]> wrote:

>
> Changing that last setting didn't work, but it got me closer.  Now,
> I'm just getting "an unknown error has occurred."  I think that I am
> getting closer.  I'm going to check what everything is referencing and
> I'll get back to you.
>
> On Dec 16, 3:15 pm, Mike Williams <[email protected]> wrote:
> > Wasn't it Kyle who wrote:
> >
> >
> >
> > >Do you know of any way around this.  I could probably just delete the
> > >error message, which would leave me at a loss when there is an error,
> > >but it could fix the issue.
> >
> > You might consider just deleting that line. It doesn't seem to do
> > anything.
> >
> > Or you could just change it to
> > setDirections("44512", "", "", "", "955 Windham Court, Boardman OH
> > 44512", "en_US");
> > --http://econym.org.uk/gmap
> > The Blackpool Community Church Javascript Team
> >
>

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