You are here

function geocoder_bing_field in Geocoder 7

Plugin callback.

1 string reference to 'geocoder_bing_field'
bing.inc in plugins/geocoder_handler/bing.inc

File

plugins/geocoder_handler/bing.inc, line 127

Code

function geocoder_bing_field($field, $field_item) {
  if ($field['type'] === 'text' || $field['type'] === 'text_long' || $field['type'] === 'text_with_summary' || $field['type'] === 'computed') {
    return geocoder_bing($field_item['value']);
  }
  if ($field['type'] === 'addressfield' && module_exists('addressfield') && !addressfield_field_is_empty($field_item, $field)) {
    $address = geocoder_widget_parse_addressfield($field_item);
    return geocoder_bing($address, array(
      'address' => $address,
    ));
  }
  if ($field['type'] === 'country' && module_exists('countries')) {
    $address = geocoder_widget_parse_countryfield($field_item);
    return geocoder_bing($address, array(
      'address' => $address,
    ));
  }
  if ($field['type'] === 'location') {
    $address = geocoder_widget_parse_locationfield($field_item);
    return geocoder_bing($address, array(
      'address' => $address,
    ));
  }
  if ($field['type'] === 'taxonomy_term_reference') {
    $term = taxonomy_term_load($field_item['tid']);
    return geocoder_bing($term->name);
  }
}