Skip to Main Content
Mapping with Drupal
book

Mapping with Drupal

by Alan Palazzolo, Thomas Turnbull
December 2011
Intermediate to advanced content levelIntermediate to advanced
150 pages
3h 50m
English
O'Reilly Media, Inc.
Content preview from Mapping with Drupal

Mapping with the GMap Module

The GMap module integrates Drupal with the Google Maps API to display maps. One of its strengths is that it is faster and simpler than using the OpenLayers API to display Google Maps. The drawback is that you are then committed to using just Google Maps. Switching to another source would require big changes to your code and data. Google Maps are not open source; they come with restrictions. However, for many purposes they are free to use.

Note

If you are going to build a site that relies on Google Maps, it is worth reading and understanding the usage limits and terms of service.

Basic Configuration

The basic configuration of the GMap module was covered in Extending the Location module with the GMap module, so if you have been following through the examples, this module should already be installed and enabled.

Integrating with Views

Unlike the OpenLayers module, GMap does not require two separate displays, so creating a map is a little simpler. Just as it was when using the OpenLayers module, the maps are created using the Views module. In this example, we will use the GMap and Views modules to create a map of “Drupal companies.” We created the “Drupal companies” content type earlier in Adding geographic data to a node with the Location module.

  1. Download and install the Views module, including the Views UI module if you do not already have these set up for your site.

  2. From the Views page, add a new view at admin/structure/views/add.

  3. For the “View name,” enter

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

High Performance Drupal

High Performance Drupal

Jeff Sheltren, Narayan Newton, Nathaniel Catchpole
Using Drupal

Using Drupal

Heather Berry, Angela Byron, James Walker, Jeff Eaton, Nathan Haug, Jeff Robbins

Publisher Resources

ISBN: 9781449311308Errata PageSupplemental Content