diff --git a/sites/all/modules/gmap/gmap.module b/sites/all/modules/gmap/gmap.module
index a90ecfb..684d7b9 100644
--- a/sites/all/modules/gmap/gmap.module
+++ b/sites/all/modules/gmap/gmap.module
@@ -497,7 +497,7 @@ function gmap_regenerate_markers() {
   $contents .= "Drupal.gmap = Drupal.gmap || {};\n";
   $contents .= "Drupal.gmap.icondata = " . drupal_json_encode(gmap_get_icondata(TRUE)) . ";\n";
 
-  $dir = 'public://js/';
+  $dir = drupal_realpath("public://js/");
   $filepath = $dir . 'gmap_markers.js';
   // Make sure js/ exists in the files folder.
   if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
