You are here

function gmap_regenerate_markers in GMap Module 6.2

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

Regenerate the markerdata file.

3 calls to gmap_regenerate_markers()
gmap_flush_caches in ./gmap.module
Implementation of hook_flush_caches().
gmap_gmap in ./gmap.module
Implementation of hook_gmap().
_gmap_rebuild_marker_js_submit in ./gmap_settings_ui.inc
Rebuild marker js.

File

./gmap.module, line 529
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);
}