Index: htdocs/sites/all/modules/contrib/ip_geoloc/ip_geoloc_api.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- htdocs/sites/all/modules/contrib/ip_geoloc/ip_geoloc_api.inc	(revision 2b0297e728fca7b4d7cf640b2ccb29925131454f)
+++ htdocs/sites/all/modules/contrib/ip_geoloc/ip_geoloc_api.inc	(revision )
@@ -110,8 +110,12 @@
   $javascript_files = drupal_add_js();
   if (empty($javascript_files[IP_GEOLOC_GOOGLE_MAPS_GPS])) {
     // Only add non-GPS version when GPS version isn't already there.
+    if( ini_get('allow_url_fopen') ) {
-    drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+      drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+    }else{
+      drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
-  }
+    }
+  }
   drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/ip_geoloc_gmap.js');
 
   $script_code = "displayGMap($latitude, $longitude, '$div_id', '$balloon_text');";
@@ -146,7 +150,11 @@
  */
 function ip_geoloc_output_map_current_location($div_id = 'ip-geoloc-map-current-location',
     $map_options = NULL, $map_style = NULL, $latitude = NULL, $longitude = NULL, $info_text = NULL) {
+  if( ini_get('allow_url_fopen') ) {
-  drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+    drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+  }else{
+    drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
+  }
   drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/ip_geoloc_gmap_current_loc.js');
 
   if (!isset($map_options)) {
@@ -186,8 +194,12 @@
   $javascript_files = drupal_add_js();
   if (empty($javascript_files[IP_GEOLOC_GOOGLE_MAPS_GPS])) {
     // Only add non-GPS version when GPS version isn't already there.
+    if( ini_get('allow_url_fopen') ) {
-    drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+      drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+    }else{
+      drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
-  }
+    }
+  }
   drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/ip_geoloc_gmap_multi_visitor.js');
 
   if (!isset($map_options)) {
@@ -258,15 +270,23 @@
     $center_option = 0, $center_latlng = array(0, 0), $visitor_location_gps = TRUE) {
 
   if ($visitor_location_gps) {
+    if( ini_get('allow_url_fopen') ) {
-    drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+      drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+    }else{
+      drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
-  }
+    }
+  }
   else {
     $javascript_files = drupal_add_js();
     if (empty($javascript_files[IP_GEOLOC_GOOGLE_MAPS_GPS])) {
       // Only add non-GPS version when GPS version isn't already there.
+      if( ini_get('allow_url_fopen') ) {
-      drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+        drupal_add_js(IP_GEOLOC_GOOGLE_MAPS, array('group' => JS_LIBRARY));
+      }else{
+        drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
-    }
-  }
+      }
+    }
+  }
   drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/ip_geoloc_gmap_multi_loc.js');
 
   if (!isset($map_options)) {
@@ -370,7 +390,11 @@
   ip_geoloc_debug(t('IPGV&M: initiating service to locate current position and reverse-geocode to address...'));
   _ip_geoloc_set_session_value('position_pending_since', microtime(TRUE));
 
+  if( ini_get('allow_url_fopen') ) {
-  drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+    drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, array('group' => JS_LIBRARY));
+  }else{
+    drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/google.maps.api.js');
+  }
   drupal_add_js(drupal_get_path('module', 'ip_geoloc') . '/js/ip_geoloc_current_location.js');
 
   $refresh_page = variable_get('ip_geoloc_page_refresh', TRUE) && !path_is_admin($_GET['q']);
