You are here

function styled_google_map_field_formatter_view in Styled Google Map 7

Same name and namespace in other branches
  1. 7.2 styled_google_map.module \styled_google_map_field_formatter_view()

Implements hook_field_formatter_view().

File

./styled_google_map.module, line 134
Contains all hooks and functions for the Styled Google Map module.

Code

function styled_google_map_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $elements = array();

  // Theme field element to a Styled Google Map with given theme variables.
  if ($display['type'] == 'styled_google_map_map_formatter') {
    foreach ($items as $item) {
      $elements[] = array(
        '#location' => $item,
        '#display' => $display,
        '#entity' => $entity,
        '#entity_type' => $entity_type,
        '#theme' => 'styled_google_map',
      );
    }
  }
  return $elements;
}