function gmap_regenerate_markers in GMap Module 5
Same name and namespace in other branches
- 6.2 gmap.module \gmap_regenerate_markers()
- 6 gmap.module \gmap_regenerate_markers()
- 7.2 gmap.module \gmap_regenerate_markers()
- 7 gmap.module \gmap_regenerate_markers()
Regenerate the markerdata file.
2 calls to gmap_regenerate_markers()
- gmap_admin_settings_validate in ./
gmap_settings_ui.inc - gmap_gmap in ./
gmap.module - Implementation of hook_gmap().
File
- ./
gmap.module, line 496 - GMap -- Routines to use the Google Maps API in Drupal.
Code
function gmap_regenerate_markers() {
$contents = '';
// Create the js/ within the files folder.
$jspath = file_create_path('js');
file_check_directory($jspath, FILE_CREATE_DIRECTORY);
$contents .= "// GMap marker image data.\n";
$contents .= "Drupal.gmap.iconpath = " . drupal_to_js(base_path() . variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') . '/markers')) . ";\n";
$contents .= "Drupal.gmap.icondata = " . drupal_to_js(gmap_get_icondata(TRUE)) . ";\n";
file_save_data($contents, "{$jspath}/gmap_markers.js", FILE_EXISTS_REPLACE);
// Also regenerate the cached marker titles array
gmap_get_marker_titles(TRUE);
}