Geofield is a Drupal 7 module that provides a field type for storing geographic data. This data can be attached to any entity, e.g., nodes, users and taxonomy terms. Geofield provides different widgets for data input and formatters for data output. It integrates with other mapping modules (including OpenLayers 2 and Geocoder),
The Geofield module can can store data as Latitude and Longitude, Bounding Box and Well Known Text (WKT) and it supports all types of geographical data: points, lines, polygons, multitypes etcetera.
Add a geofield to content
You can add geographical information to an entity (content type, user, taxonomy term or comment) by adding a geofield.
To add a geofield to e.g., a "Basic Page" go to /admin/structure/types/manage/page/fields/
Add a new field of the field type "Geofield", and choose the preferred widget, e.g., "OpenLayers Map". Configure the field according to the chosen options.
Display geographical information
Geofield comes with the basic but easy-to-use submodule Geofield Map that allows you to display geographical data in a Google map.
For more advanced and flexible data display you need to create and configure a map in OpenLayers 2.
If you use OpenLayers you need to enable the OpenLayers UI. After, you can set Geofield Formatter Map output as default map in /admin/structure/openlayers/. Choose "Geofield Formatter Map" in the field OpenLayers Default Map.
You can easily create your own map by cloning an existing one. Introduction to OpenLayers.
When you have configured a map in OpenLayers you must define to use the map for displaying data at /admin/structure/types/manage/page/display/.
Geofield integrates also with the lightweight map display tool Leaflet
Microdata & Schema.org
Geofield supports microdata, which can be used by scripts and search engines to extract the Geo information in a meaningful way.
When you have Microdata module enabled, you can configure your microdata output on the field configuration page. There are suggestions of appropriate Schema.org settings at the bottom of the form. Choose one and click "Use suggested mapping".
- Book: Mapping with Drupal
- Drupaleasy Podcast episode on mapping in Drupal
- Tutorial on using a world map to display photography galleries
- Webinar about mapping in Drupal
- Presentation about mapping in Drupal
- "X Marks the Spot: A Beginner's Guide to Online Mapping in Drupal" screencast and blog post. Covers Geofield, GeoCoder, Address Field, and Leaflet modules.