Draggable Markers and Directions (linking to Google's own page)

43 views
Skip to first unread message

Paul Melhuish

unread,
Jan 7, 2012, 7:00:18 PM1/7/12
to google-map...@googlegroups.com
First I have to confess to being something of a javascript virgin, so I am finding Google Maps a bit of a struggle.

However I have nearly achieved a nice page to provide directions to a hotel from any start point. I am just stuck on the final stage of passing the right arguments in the link to Google's own Maps page.

http://test.littlehotelsofspain.co.uk/location3-nearlyworks.php?hid=colorado is the nearest I have got so far.

There are two icons on the map representing the start and destination points. The destination is the hotel so that is fixed. The start is my suggestion of a likely starting point (the nearest airport) but the user can drag that to anywhere else they want.

All that works fine and the above page is temporarily displaying the lat-long of the start point at top right, just for clarity. That is the lat-long that I need to put in as the value of "saddr" in the line
http://maps.google.com/maps?saddr={start_address}&daddr={destination_address}

I'm sure I'm very close and I just need an experienced hand to guide me on the last step to success. I've added a few comment lines to the above page to try to explain to any kind helper what I am trying to do.

Thanks in anticipation.

Paul Melhuish

unread,
Jan 9, 2012, 4:30:27 AM1/9/12
to google-map...@googlegroups.com
After a lot of trial and error and searching on various Javascript forums and tutorials, I managed to find the solution. The page linked to above will now disappear.

Rossko

unread,
Jan 9, 2012, 2:33:35 PM1/9/12
to Google Maps JavaScript API v3
> After a lot of trial and error and searching on various Javascript forums
> and tutorials, I managed to find the solution. The page linked to above
> will now disappear.

Excellent, that will encourage the next person to run into this
problem to keep looking, knowing there is a solution out there
somewhere.
Reply all
Reply to author
Forward
0 new messages