Directions to Store.

9 views
Skip to first unread message

Ando

unread,
Jan 28, 2010, 3:34:25 AM1/28/10
to Google Maps JavaScript API v3
I am making a v3 map nd am trying to make a directions function. I am
trying to make it so if the type the address into the field and hit
the submit button (which is in the info window) it displays the
directions.

The link to the website is http://linea.websitewelcome.com/~prsrcom/

Also if you are running a debu program on this i am aware of the two
errors in my styles for my navigation menu, it is not a main focus at
the moment.

Any help on the map direction function would be great, if this can be
done.

At the moment i also have a onclick event but it may have to be a form
action, again any suggestions appreciated.

Esa

unread,
Jan 29, 2010, 6:01:30 AM1/29/10
to Google Maps JavaScript API v3

On Jan 28, 10:34 am, Ando <jaykea...@gmail.com> wrote:

> At the moment i also have a onclick event but it may have to be a form
> action, again any suggestions appreciated.


Action is better because it is triggered by Enter key as well.

You have not constructed a DirectionsRenderer(). Doublecheck also
typos.
(directionDisplay != directionsDisplay)

Ando

unread,
Jan 29, 2010, 7:09:41 PM1/29/10
to Google Maps JavaScript API v3
Can you not have a lat/lng coo-ordinate for the directions to?

As when i run a debugger in firefox it gives me the following error;

Error: Error in property <destination>: (Invalid value: 152.981743 ())
Source File: http://maps.gstatic.com/intl/en_us/mapfiles/api-3/27a/main.js

Although even using an address such as
var end = "25/39 Aerodrome Rd, Caboolture QLD";

It is no longer displaying an error but still not displaying results.

I have added the directions render and checked typos and still have
not got the directions to display.

The link to the site is
http://linea.websitewelcome.com/~prsrcom/storelocation.html
again any more help on the not displaying directions results not
displaying would be appreciated.

Ando

Ando

unread,
Jan 29, 2010, 7:17:03 PM1/29/10
to Google Maps JavaScript API v3

On Jan 30, 10:09 am, Ando <jaykea...@gmail.com> wrote:

> I have added the directions render and checked typos and still have
> not got the directions to display.

i did find one typo after this being the div did not have a : between
the height and size, although this did not fix the problem

Esa

unread,
Jan 29, 2010, 8:03:47 PM1/29/10
to Google Maps JavaScript API v3
The page reloads when submit is clicked.

<form onsubmit="calcRoute();">

'action' attribute must be given and making 'onsubmit' to return false
prevents the reload.

<form action="#" onsubmit="calcRoute(); return false">

Ando

unread,
Jan 29, 2010, 8:36:08 PM1/29/10
to Google Maps JavaScript API v3
Thank you solved the problem.
Reply all
Reply to author
Forward
0 new messages