O'Reilly logo

Drupal 7 Cookbook by Dylan James

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a Google Map to content

Google Maps is a useful tool for describing locations of places, but implementing this manually involves writing some custom JavaScript code, which is not good for non-technical editors. In this recipe, we will be using the Location and GMaps modules to add a Castle content type with a Location field, which outputs its location on a Google Map. The Location field will feature various location attributes and a geocoding service, which will automatically plot the marker on the map, as shown in the following screenshot:

Adding a Google Map to content

Getting ready

You will need to install the most recent releases of the following modules:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required