You are here

function leaflet_map_get_info in Leaflet 7

Same name and namespace in other branches
  1. 8 leaflet.module \leaflet_map_get_info()
  2. 2.1.x leaflet.module \leaflet_map_get_info()
  3. 2.0.x leaflet.module \leaflet_map_get_info()

Get all available Leaflet map definitions.

@string $map The name of the map defined in hook_leaflet_map_get_info().

5 calls to leaflet_map_get_info()
leaflet_field_formatter_settings_form in ./leaflet.formatters.inc
Implements hook_field_formatter_settings_form().
leaflet_field_formatter_view in ./leaflet.formatters.inc
Implements hook_field_formatter_view().
leaflet_requirements in ./leaflet.install
Implements hook_requirements().
leaflet_views_plugin_style::options_form in leaflet_views/leaflet_views_plugin_style.inc
Options form.
leaflet_views_plugin_style::render in leaflet_views/leaflet_views_plugin_style.inc
Renders view.

File

./leaflet.module, line 190

Code

function leaflet_map_get_info($map = NULL) {
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['leaflet_map_info'] =& drupal_static(__FUNCTION__);
  }
  $map_info =& $drupal_static_fast['leaflet_map_info'];
  if (empty($map_info)) {
    if ($cache = cache_get("leaflet_map_info")) {
      $map_info = $cache->data;
    }
    else {
      $map_info = module_invoke_all('leaflet_map_info');

      // Let other modules alter the map info.
      drupal_alter('leaflet_map_info', $map_info);
      cache_set("leaflet_map_info", $map_info);
    }
  }
  if (empty($map)) {
    return $map_info;
  }
  elseif (isset($map_info[$map])) {
    return $map_info[$map];
  }
}