You are here: Blog » Code Snippets » Google Maps Get Directions Code for Website

Google Maps Get Directions Code for Website


With more and more of the web shifting to mobile, it has become increasingly helpful to provide your users with a google maps get directions link which will lead them to your desired destination address.

Without any further ado, use this Google maps get directions code for website to easily provide your website visitors with directions to wherever you want them go.

Suppose you want to send them to the address of the White House, which is:

1600 Pennsylvania Ave NW
Washington, DC 20500

You would use the following code:

Try the ‘get directions link’ in action:

Get Directions

By setting the source address to ‘Current Location’, Google is able to automatically set the starting point relative to the location of the user’s device.
If the user is on a mobile device, such as an Android or iPhone, and the device has the Google Maps mobile app installed, when the link is clicked, this will bring up turn-by-turn GPS navigation to the destination. Even if they don’t have the Google Maps app, this will still fire up the ‘get directions’ feature from within the Google Maps website ( This means that desktop users can also benefit from this feature.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">