View All Posts

Automatically Generate a Google Address Link or Map

Let's say you have dynamic data of a phone number, email and street address of a person or business and you want to show that data as useful links("mailto:","tel:","sms:" etc...).  It is fairly easy to write a PHP or JS script to automatically turn a phone number or an email into links. However generating an address that links to google maps or even better an address that turns into an embedded map is a little more complicated. Below is a working example and code you can use to do just that..

See the Pen Automatically Generate a Google Address Link or Map by Michael Stursberg (@thesturs) on CodePen.11170

Take note of how the "address" tag is wrapped around the address and the classes in the HTML part of the codepen.

 

Posted: July 26th, 2016
Category: Development
Tags: ,