Andy Jarrett // Code. Develop. Create.

Embedding Google Maps in emails

Adding Google maps to emails is not something I ever wanted to do but luckily Google have Static Maps API V2 for when you need maps without requiring JavaScript or any dynamic page loading (something email clients don't handle well).

Calling the maps is easy, in short its a link with some params i.e. https://maps.googleapis.com/maps/api/staticmap?{params}. By simply specifiying where to center the map, zoom level, and even the size of image to generate you can quickly get a map view.

google map of london

https://maps.googleapis.com/maps/api/staticmap?center=london&
amp;zoom=14&size=400x100&sensor=false

You can even take this further and add in markers by specifying size, colour, label, and location.

http://maps.googleapis.com/maps/api/staticmap?center=London,uk&zoom=13&size=400x100&
markers=color:blue|label:A|51.507359,-0.115592&sensor=false

This just scratches the surface, Check out the URL params, and the site in general to see what else you can do


I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️