You are here

function yamaps_field_formatter_info in Yandex.Maps 7

Implements hook_field_formatter_info().

File

inc/yamaps.formatter.inc, line 11
Yandex Maps field formatter.

Code

function yamaps_field_formatter_info() {
  return [
    // Dynamic map formatter.
    YAMAPS_DYNAMIC_FORMATTER => [
      'label' => t('Dynamic'),
      'field types' => [
        'field_yamaps',
      ],
      'settings' => [
        'controls' => TRUE,
        'traffic' => TRUE,
        'clusterer' => FALSE,
        'auto_zoom' => FALSE,
        'width' => YAMAPS_DEFAULT_DYNAMIC_WIDTH,
        'height' => YAMAPS_DEFAULT_DYNAMIC_HEIGHT,
        'behaviors' => [
          'clickZoom',
          'dblClickZoom',
          'drag',
          'scrollZoom',
          'ruler',
          'rightMouseButtonMagnifier',
        ],
        'yamaps_display_options' => [
          'display_type' => 'map',
          'open_button_text' => YAMAPS_DEFAULT_OPEN_MAP_TEXT,
          'close_button_text' => YAMAPS_DEFAULT_CLOSE_MAP_TEXT,
        ],
      ],
    ],
    // Static map formatter.
    YAMAPS_STATIC_FORMATTER => [
      'label' => t('Static'),
      'field types' => [
        'field_yamaps',
      ],
      'settings' => [
        's_traffic' => FALSE,
        's_clusterer' => FALSE,
        's_auto_zoom' => FALSE,
        's_width' => YAMAPS_DEFAULT_STATIC_WIDTH,
        's_height' => YAMAPS_DEFAULT_STATIC_HEIGHT,
        'yamaps_display_options_static' => [
          'display_type_static' => 'map',
          'open_button_text_static' => YAMAPS_DEFAULT_OPEN_MAP_TEXT,
          'close_button_text_static' => YAMAPS_DEFAULT_CLOSE_MAP_TEXT,
        ],
      ],
    ],
    // Simple text formatter.
    YAMAPS_TEXT_FORMATTER => [
      'label' => t('Yandex map formatter from the one-line address'),
      'field types' => [
        'text',
      ],
      'settings' => [
        'width' => YAMAPS_DEFAULT_DYNAMIC_WIDTH,
        'height' => YAMAPS_DEFAULT_DYNAMIC_HEIGHT,
        'placemark' => [
          'placemark_display' => TRUE,
          'placemark_text' => '[address]',
          'placemark_color' => 'blue',
        ],
        'behaviors' => array_keys(yamaps_get_behaviors_list()),
        'control' => TRUE,
        'traffic' => FALSE,
        'clusterer' => FALSE,
        'auto_zoom' => FALSE,
      ],
    ],
  ];
}