01 May 2005
Add Google Maps’ Directions to Your Site
Google Maps has already spawned some interesting hacking and sightseeing, and recently launched a UK service.
If you have a business which gets visitors to its premises you’ve probably created some kind of map yourself and maybe tried to write some generalised directions, but it can be tricky to get right. Using a simple form on your site you can also offer users a personalised map and directions courtesy of Google Maps. Just modify the appropriate code snippet below to include the destination and any extra formatting markup needed.
(Sorry if this is old news or seems obvious; I’ve not seen it covered anywhere and it won’t be obvious for most people.)
(Update: they’ve now released the Google Maps API for embedding maps and adding your own data.)
USA
<form action="http://maps.google.com/maps" method="get">
<p><label for="saddr">Your ZIP code</label>
<input type="text" name="saddr" id="saddr" value="" />
<input type="submit" value="Go" />
<input type="hidden" name="daddr" value="[destination]" />
<input type="hidden" name="hl" value="en" /></p>
</form>
Example: Show me the way to Amarillo
UK
<form action="http://maps.google.co.uk/maps" method="get">
<p><label for="saddr">Your postcode</label>
<input type="text" name="saddr" id="saddr" value="" />
<input type="submit" value="Go" />
<input type="hidden" name="daddr" value="[destination]" />
<input type="hidden" name="hl" value="en" /></p>
</form>
Comments
— Russell, 28th May, 5:35pm
— Hashim, 29th May, 1:08am
— automatt, 29th May, 8:02am
— XeroCool, 29th May, 6:23pm
— Jennifer, 29th May, 11:18pm
— the biscuit man, 30th May, 7:28am
— moseleyblogger, 30th May, 9:05am
— andrew, 30th May, 4:09pm
— NHJim, 31st May, 8:50pm
— Matt Round, 31st May, 10:01pm
— Phillip Harrington, 31st May, 11:55pm
— Jeff, 3rd Jun, 5:48am
— John Forsyth, 3rd Jun, 8:19am
— rhago32, 3rd Jun, 9:05am
— Matt Round, 3rd Jun, 2:04pm
— Brian Drews, 3rd Jun, 7:49pm
— KJ Sampat, 3rd Jun, 8:35pm
— Ernie, 4th Jun, 1:05am
— rhago32, 7th Jun, 12:03pm
— rhago32, 7th Jun, 12:21pm
— Matt Round, 7th Jun, 12:29pm
— rhago32, 10th Jun, 7:00am
— ad, 13th Jun, 7:43pm
— Matt Round, 13th Jun, 8:35pm
— Lawrence, 13th Jun, 11:20pm
— Matt Round, 14th Jun, 7:58am
— sarah, 14th Jun, 8:28pm
— Matt Round, 14th Jun, 9:01pm
— Armen Shagmirian, 13th Sep, 6:35pm
— Marc Woolfson, 15th Sep, 11:34am
— Orlando, 7th Oct, 5:58am
— Matt Round, 8th Oct, 8:05am
— Orlando, 8th Oct, 9:51pm
Comments are now closed for this entry.