You are here

function geofield_field_formatter_info in Geofield 7.2

Same name and namespace in other branches
  1. 7 geofield.formatters.inc \geofield_field_formatter_info()

Implements hook_field_formatter_info().

File

./geofield.formatters.inc, line 11
Drupal field formatter hooks and helper functions.

Code

function geofield_field_formatter_info() {
  $formatters = array(
    'geofield_wkt' => array(
      'label' => t('Well Known Text (WKT)'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
    'geofield_geojson' => array(
      'label' => t('GeoJSON'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
    'geofield_kml' => array(
      'label' => t('KML'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
    'geofield_gpx' => array(
      'label' => t('GPX'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
    'geofield_geohash' => array(
      'label' => t('Geohash'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
    'geofield_latlon' => array(
      'label' => t('Latitude/Longitude'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
        'format' => 'decimal_degrees',
        'labels' => 1,
      ),
    ),
    'geofield_lat' => array(
      'label' => t('Latitude Only'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
        'format' => 'decimal_degrees',
      ),
    ),
    'geofield_lon' => array(
      'label' => t('Longitude Only'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
        'format' => 'decimal_degrees',
      ),
    ),
    'geofield_geo_type' => array(
      'label' => t('Geometry Type'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
      ),
    ),
  );
  if (module_exists('openlayers')) {
    $formatters['geofield_openlayers'] = array(
      'label' => t('OpenLayers'),
      'field types' => array(
        'geofield',
      ),
      'settings' => array(
        'data' => 'full',
        'map_preset' => 'geofield_formatter_map',
      ),
    );
  }

  // Accessibility formatters for blind users with screen-readers
  $formatters['geofield_def_list'] = array(
    'label' => t('Definition List (Accessibility)'),
    'field types' => array(
      'geofield',
    ),
    'settings' => array(
      'data' => '',
      'address' => 0,
    ),
  );
  $formatters['geofield_description'] = array(
    'label' => t('Descriptive Text (Accessibility)'),
    'field types' => array(
      'geofield',
    ),
    'settings' => array(
      'data' => '',
      'address' => 0,
    ),
  );
  return $formatters;
}