You are here

function openlayers_cck_field_formatter_info in Openlayers 6

Same name and namespace in other branches
  1. 6.2 modules/openlayers_cck/openlayers_cck.module \openlayers_cck_field_formatter_info()

Implementation of hook_field_formatter_info().

File

modules/openlayers_cck/openlayers_cck.module, line 479
This file holds the main Drupal hook functions and private functions for the openlayers_cck module.

Code

function openlayers_cck_field_formatter_info() {
  $formatters = array();

  // Default formatter
  $formatters['default'] = array(
    'label' => t('WKT Value'),
    'field types' => array(
      'openlayers_wkt',
    ),
    'multiple values' => CONTENT_HANDLE_MODULE,
    'gis types' => array(
      'point',
      'linestring',
      'polygon',
    ),
    'gis input' => 'wkt',
  );

  // Map preset formatter
  foreach (openlayers_get_presets() as $name => $title) {
    $formatters['openlayers_map_' . $name] = array(
      'label' => t('OpenLayers Map: @preset', array(
        '@preset' => check_plain($title),
      )),
      'field types' => array(
        'geo',
        'geo_data',
        'openlayers_wkt',
      ),
      'multiple values' => CONTENT_HANDLE_MODULE,
      'gis types' => array(
        'point',
        'linestring',
        'polygon',
      ),
      'gis input' => 'wkt',
    );
  }
  return $formatters;
}