Geofield is a Drupal 7 & Drupal 8 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.
The Geofield module 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 etc.
It integrates with other mapping modules such as:
- Geofield Map: an advanced, complete and easy-to-use Geo Mapping solution for Drupal 8, based on Geofield
- OpenLayers: A very powerful mapping system based on the OpenLayers JavaScript library.
- Static Map: Simple maps based on Google Maps
- Leaflet: Moderately powerful mapping system based on the Leaflet JavaScript library
- Geocoder: Geocode string & text addresses or file-uploads into Geofield locations and viceversa (Reverse Geocode)
and more ...
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 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