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:
<a href="http://maps.google.com/maps?f=d&source=s_d&saddr=Current%20Location&daddr=1600+Pennsylvania+Ave+NW,+Washington,+DC+20500" target="_blank">Get Directions</a>
Try the ‘get directions link’ in action:
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 (maps.google.com). This means that desktop users can also benefit from this feature.