You are here

function geocoder_gpx_field in Geocoder 7

Plugin callback.

1 string reference to 'geocoder_gpx_field'
gpx.inc in plugins/geocoder_handler/gpx.inc

File

plugins/geocoder_handler/gpx.inc, line 31

Code

function geocoder_gpx_field($field, $field_item) {
  if ($field['type'] === 'text' || $field['type'] === 'text_long' || $field['type'] === 'computed') {
    return geocoder_gpx($field_item['value']);
  }
  if ($field['type'] === 'file') {
    if ($field_item['fid']) {
      $file = file_load($field_item['fid']);
      $gpx = file_get_contents($file->uri);
      return geocoder_gpx($gpx);
    }
  }
}