Embedding a Google map that centres on an address stored in a field

Hi folks, here’s a quick tutorial about how you can embed a map that is centred on an address that is stored in a field. I’m using Stacker Tables for this, but it should work just as well on Airtable / Google Sheets. Shout out to @seb who actually did the hard work looking up how to do this and creating the formula needed!

To do this, you’ll need a Google Maps API key - you can find details of how you do this here.

For this example, I’ve got a simple table set up with addresses as below. PS - these are the best coffee shops in Edinburgh, if you happen to visit.

You then need to create a Formula field with the following formula that takes your addresses and puts them in a format Google Maps understands.

CONCAT(CONCAT("https://www.google.com/maps/embed/v1/place?q=", REGEX_REPLACE({Address}, " ", "+")), "&key=your-API-key")

You should end up with something like the below:

And finally, if you go to the detail view you want to show the map on, and choose your Formula field as the source, it should display nicely. You can make the map bigger or smaller with the Height setting.

There you go! Any questions, just let me know :slight_smile:

4 Likes