You are here

function gmap_ajax_data_alter in GMap Module 6.2

Same name and namespace in other branches
  1. 6 gmap.module \gmap_ajax_data_alter()

Implementation of hook_ajax_data_alter().

File

./gmap.module, line 1318
GMap -- Routines to use the Google Maps API in Drupal.

Code

function gmap_ajax_data_alter(&$object, $views, $view) {

  // Add js callback only with gmap style plugins and with ajax.
  if ($view->plugin_name != 'gmap' || !$view->use_ajax) {
    return;
  }

  // Save settings.
  $js = drupal_add_js(NULL, NULL, 'header');
  $object->settings = $js['setting'];

  // Register custom callback.
  $object->__callbacks = array_merge($object->__callbacks, array(
    'Drupal.gmapAjax.ajaxFixMaps',
  ));
}