This module is about the simplest way to display a Google Map, and/or a link to a Google Map, in your content. It provides a field formatter for Drupal plain text fields (it can also be used on Computed Fields module fields). You enter an address that Google Maps can recognize in the field, and the formatter displays it as a dynamic Google map, a static Google map (without the ability to zoom/pan etc.), a link to Google Maps, or some combination.

If you want to do something more complicated than this, such as displaying location fields from multiple nodes on a map, see:
https://www.drupal.org/project/gmap

Installation and configuration

  1. Install/enable as any other module. No additional downloads are required.
  2. Add a plain Text field to your content type, taxonomy vocabulary, user accounts, comment type, or whatever. (Fields from the Computed Fields contributed module are also supported.) You probably should add some Help text to the field to explain that a one-line address that Google Maps can recognize needs to be entered, and that the output will be formatted with a map (or a link or both, depending on how you are using this field).
  3. On the Manage Display screen, choose the provided mapping formatter for your text field, and make sure the field is not Hidden.
  4. If desired, change the field display settings. For static maps, you will need to enter a Google maps API key and set up billing for maps with Google.
  5. After you have it all set up, make sure to click Save/Submit at the bottom of the Manage Display page.

You can also use this formatter to display the field in Views. Add the text field you set up to your view, choose the map formatter, and set options as desired.

You can also override the display output of this formatter in your theme, by overriding the simple-gmap-output.tpl.php file in the usual way (in Drupal 8, the template file is templates/simple-gmap-output.html.twig).

Caveats and notes

  • Several users have experienced problems when attempting to embed a dynamic map display in a tab, collapsed field set, Panels, etc. This is due to bugs in Google Maps itself, and there is not anything that can be done about it in this module, unfortunately. For more information, see: #2166781: [meta] Display issues with Simple Google Maps.
  • In the past, Google allowed people to embed maps in their site without an account. At some point, they changed it so that you needed an API key in order to display static maps (and this module added the ability to enter your API key in the settings). Later still, Google changed its policy so you now need to set up billing (give them a credit card number) in order to use an API key to display static maps. At this time, embedding a dynamic map does not require an API key or billing, and making a link works without an API key (that just links to a Google URL).

Project information

Releases