Skip to content

Instantly share code, notes, and snippets.

@carlos-sanchez
Created November 14, 2013 04:30
Show Gist options
  • Save carlos-sanchez/7461377 to your computer and use it in GitHub Desktop.
Save carlos-sanchez/7461377 to your computer and use it in GitHub Desktop.
Get Directions on Google Maps. Simple yet powerful code to create a form where the user can enter his location to get directions to a specific place. Very useful for contact pages.
<form action="http://maps.google.com/maps" method="get" target="_blank">
<label for="saddr">Enter your location</label>
<input type="text" name="saddr" />
<input type="hidden" name="daddr" value="350 5th Ave New York, NY 10018 (Empire State Building)" />
<input type="submit" value="Get directions" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment