howtos » Using the Google Static Maps API to include maps in your emails
Using the Google Static Maps API to include maps in your emails
The
Google Maps API is a great way to utilise Google’s Maps platform on your own website. The standard Maps API, however, does not work in e-mails as it is reliant on JavaScript which most (if not all) e-mail clients block.
Luckily there is a solution thanks to the
Google Static Maps API. The Static Maps API generates an image file that can be embedded into your HTML content (like below). Because it is an image, and there is no JavaScript involved, mail clients will display such a map. You can specify the location of the map, the size of the image, the zoom level, the type of map, and the placement of optional markers at locations on the map using the API. For example:
Getting started is easy!
- Sign up for a Google Maps API key
- Use the Google Static Map Wizard to create your first static map
- Read the Google Maps Static API documentation
This method is great for also providing map content in other mediums that don’t support JavaScript - such as mobile content.
Leave a comment