You are here

function gmap_views_pre_render in GMap Module 6

Same name and namespace in other branches
  1. 6.2 gmap.module \gmap_views_pre_render()
  2. 7.2 gmap.module \gmap_views_pre_render()
  3. 7 gmap.module \gmap_views_pre_render()

Implementation of hook_views_pre_render().

File

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

Code

function gmap_views_pre_render(&$view) {
  static $gmap_processed;

  // Add js only for gmap style views with ajax and not already processed.
  if ($view->plugin_name != 'gmap' && !$view->use_ajax || $gmap_processed) {
    return;
  }

  // Mark the view as already processed.
  $gmap_processed = TRUE;

  // Add js with new views callback.
  drupal_add_js(drupal_get_path('module', 'gmap') . '/js/gmap_views_ajax.js', 'module');
}