Chapter 7. Managing Maps as Features

Throughout the tutorials in this book, all the configuration has been done through the user interface. Drupal stores this configuration in your database, which is a problem for two main reasons:

  1. It is difficult to manage these changes when deploying or changing environments.

  2. There is no history log of modifications.

One tool that has been developed over the last couple of years to solve this is the Features module. With the Features module, all the work you have done configuring your map settings can be bundled up and saved in a handy format. You can then reuse the configurations in your next mapping project, and share them with other Drupal developers. Your settings can be easily backed up with version control. For more background on Features, see the Features handbook page.

Features is well supported by OpenLayers and Geofield. Much of the configuration for maps built with GMap and Location is based on Views, which also has good support for the Features module. In this section we will walk through the process of exporting your map configurations to Features.

Note

There are other ways to export configuration to code, such as CTools export, but the Features module is the simplest to use.

The first step is to set up the Features module and another module that helps with this process: the Strongarm module.

  1. Download the latest stable release of the Features module and the Strongarm module to your site’s Modules directory.

  2. Enable the Features module.

  3. Configure ...

Get Mapping with Drupal now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.