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.

Install

Install and enable the Geofield module and its required module geoPHP in the usual way. Learn more about installing Drupal modules.

Add a geofield to content

You can add geographical information to a content type 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.

Note: Remember that you can also add a geofield to a user, a taxonomy term or a comment.

Display geographical information

Geofield Map

Geofield comes with the basic but easy-to-use submodule Geofield Map that allows you to display geographical data in a Google map.

OpenLayers

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/.

Leaflet

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".

More info