Geolocation field
Last updated on
30 April 2025
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
This patch for Geolocation field module provides a destination handler which exposes geolocation fields for mapping.
Geolocation field requires both latitude and longitude values, so it doesn't make sense to use the primary value, i.e. map to field itself.
In order to use it, please map values to the subfields (mapping to the field won't work)
Fields
lat - Geolocation field latitude value
lng - Geolocation field longitude value
language - Geolocation field value language
Example
// Correct way: map to subfields.
$this->addFieldMapping('field_geolocation:lat', 'geolocation_lat');
$this->addFieldMapping('field_geolocation:lng', 'geolocation_lng');
// Incorrect way: map to the field itself.
$this->addFieldMapping('field_geolocation', 'geolocation');
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion