function _gmap_doheader in GMap Module 7
Same name and namespace in other branches
- 5 gmap.module \_gmap_doheader()
- 6.2 gmap.module \_gmap_doheader()
- 6 gmap.module \_gmap_doheader()
- 7.2 gmap.module \_gmap_doheader()
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.
1 call to _gmap_doheader()
- theme_gmap in ./
gmap.module - Gmap element theme hook
File
- ./
gmap.module, line 346 - GMap -- Routines to use the Google Maps API in Drupal.
Code
function _gmap_doheader() {
static $gmap_initialized = FALSE;
if ($gmap_initialized) {
return;
}
$gmap_path = drupal_get_path('module', 'gmap');
$mm = variable_get('gmap_mm_type', 'gmap');
$mms = variable_get('gmap_markermanager', array());
if (empty($mms[$mm])) {
$mms[$mm] = array();
}
// If you really really want to override the marker manager, implement
// this, take $mm by ref, and have fun. --Bdragon
if (function_exists('_gmap_markermanager_override')) {
_gmap_markermanager_override($mm, $mms);
}
if ($mm == 'clusterer' || $mm == 'clustermarker') {
// Needed for access to clusterer marker.
// drupal_add_js($gmap_path . '/js/icon.js');
}
if (isset($mms[$mm]['filename'])) {
// drupal_add_js($gmap_path . '/thirdparty/' . $mms[$mm]['filename']);
}
// drupal_add_js($gmap_path . '/js/marker.js');
// drupal_add_js($gmap_path . '/js/highlight.js');
// drupal_add_js($gmap_path . '/js/' . $mm . '_marker.js');
drupal_add_js(array(
'gmap_markermanager' => $mms[$mm],
), 'setting');
$gmap_initialized = TRUE;
}