Get Directions

1 view
Skip to first unread message

Trueskool

unread,
Jul 24, 2008, 12:14:23 PM7/24/08
to Google Maps EZ, james...@gmail.com
Hey,

Firstly awesome piece of software you've written here it's absolutely
superb! I plan to make a donation once I get everything setup and
working how I would like it.

Secondly, I was just wondering if there was code or something to
include a "Get Directions" link in the markets popup window. I'm
guessing it would take the location and then run the directions
command.

Thanks in advance!

Regards,

Robert Fleming

unread,
Jul 25, 2008, 1:34:35 PM7/25/08
to Google-...@googlegroups.com, Trueskool

> -----Original Message-----
> From: Trueskool [mailto:james...@gmail.com]
> Secondly, I was just wondering if there was code or something to
> include a "Get Directions" link in the markets popup window. I'm
> guessing it would take the location and then run the directions
> command.

If you look at my site - http://www.trileisure.com/map, I have a 2nd tab
in the info window with a form to get an address and provide directions
to the location. The code for the 2nd tab is:
<div title="Directions">
<form method="post" action="/get_map.php"

onsubmit="location.href='http://maps.google.com/maps?q=from+'+
this.addr.value + '+to+53.550252,-113.935862&amp;f=d&amp;hl=en';
return false;">
<P>
<br>Directions to here from: <br/>
<input type="text" size="40" name="addr" />
<br />
<input type="submit" value="Get Directions To Here" />
<br>[opens in a new window]
</P>
</form>
</div>

This does a query to google maps and brings up the results in their
window.

HTH

Rob

Trueskool

unread,
Jul 26, 2008, 10:14:57 AM7/26/08
to Google Maps EZ
Awesome thanks!

Not sure if i need this, though I'm pretty sure that I do.

Do you have the php for the get_map.php file?

On Jul 25, 1:34 pm, "Robert Fleming" <rflem...@TriLeisure.com> wrote:
> > -----Original Message-----
> > From: Trueskool [mailto:james.ne...@gmail.com]
> > Secondly, I was just wondering if there was code or something to
> > include a "Get Directions" link in the markets popup window. I'm
> > guessing it would take the location and then run the directions
> > command.
>
> If you look at my site -http://www.trileisure.com/map, I have a 2nd tab

Robert Fleming

unread,
Jul 28, 2008, 4:10:52 PM7/28/08
to Google-...@googlegroups.com
Here are the contents of the get_map.php file (should be one line):

<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://maps.google.com/maps?q=from+
<? print $_POST['addr'] ?>+to+53.550252,-113.935862&f=d&hl=en">

It's only there for browsers that don't support (or have disabled) javascript and therefore can't act on the onSubmit function.

HTH

Rob

neil

unread,
Aug 7, 2008, 5:21:53 PM8/7/08
to Google Maps EZ
Nice one Rob. Splendid bit of useful coding!
Thanks Neil
> > > Rob- Hide quoted text -
>
> - Show quoted text -

neil

unread,
Aug 9, 2008, 8:40:23 AM8/9/08
to Google Maps EZ
Modded Rob's nifty bit of coding....
It just adds the Directions option to an existing info window (no 2nd
tab) and as my starting point is fixed have programmed it directly
into the command.
.....<a href="#" onclick="location.href='http://maps.google.com/maps?
q=from+'+ 'Largo da República @37.085934, -8.730550' +'+to
+37.10071437651224,-8.670358657836914&amp;f=d&amp;hl=en'; return
false;">[ Directions ]</a>....
Unfortunately it opens the google map in the same window rather than a
new one, yet to resolve that bit.
> > - Show quoted text -- Hide quoted text -

TrainPixsNetwork

unread,
Aug 9, 2008, 4:19:50 PM8/9/08
to Google Maps EZ
so that you can open the directions page in a new window use this...

...<a href="#" onclick="window.open('http://maps.google.com/maps?
q=...'); return false;">

the only thing is that wen you it submit, the window will open but the
text bubble will continue to stay "open." Does anyone have any
suggestions on how to have the text buble close after hitting the
"submit" button?

Thanks,
Nathan Chidester, Webmaster
the TrainPixs Network | http://www.trainweb.org/trainpixsnet

neil

unread,
Aug 10, 2008, 7:32:01 AM8/10/08
to Google Maps EZ
Thanks Nathan, thats what I was looking for. Not worried too much
about the bubble staying open as it indicates what you were looking
originally on the 'un-zoomed' map.
Reply all
Reply to author
Forward
0 new messages