You are here

function openlayers_test_openlayers_map_preprocess_alter in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 tests/openlayers_test.module \openlayers_test_openlayers_map_preprocess_alter()

Impements hook_openlayers_map_preprocess_alter().

File

tests/openlayers_test.module, line 100
Main OpenLayers Test Module file

Code

function openlayers_test_openlayers_map_preprocess_alter(&$map) {

  // For testing purposes, display a message on the only the Test
  // page, and only once.
  static $performed = FALSE;
  if (!$performed && $_GET['q'] == 'admin/structure/openlayers/test') {
    drupal_set_message(t('OpenLayers preprocess map alter hook fired.'));
    $performed = TRUE;
  }

  // Add stop render for JS testing
  if ($_GET['q'] == 'admin/structure/openlayers/test/js') {
    $map['stop_render'] = TRUE;
  }
}