You are here

function gmap_get_key in GMap Module 6.2

Same name and namespace in other branches
  1. 5 gmap.module \gmap_get_key()
  2. 6 gmap.module \gmap_get_key()
  3. 7.2 gmap.module \gmap_get_key()
  4. 7 gmap.module \gmap_get_key()

Retrieve the Google Maps key that is in use for the site.

1 call to gmap_get_key()
_gmap_doheader in ./gmap.module
Set up the HTML header for GMap. If you are going to include a custom JS file that extends GMap, you probabaly want to call this first to ensure that the core js files have been added.

File

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

Code

function gmap_get_key() {
  $key = variable_get('gmap_api_key', '');
  if (module_exists('keys_api')) {
    $key = keys_api_get_key('gmap', $_SERVER['HTTP_HOST']);
  }
  elseif (module_exists('keys')) {
    $key = keys_get_key('google_maps');
  }
  return $key;
}