From 0d58fac0dff74f353e3467c01da62e0c2e30f359 Mon Sep 17 00:00:00 2001
From: "haiiro.shimeji" <haiiro.shimeji@gmail.com>
Date: Thu, 12 Apr 2012 14:49:24 +0900
Subject: [PATCH] Issure #1506434 Make the API key field optional

---
 gmap.module          | 6 ------
 gmap_settings_ui.inc | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/gmap.module b/gmap.module
index 1d4d7fc..0f91f7b 100644
--- a/gmap.module
+++ b/gmap.module
@@ -921,12 +921,6 @@ function gmap_map_cleanup(&$map) {
 function theme_gmap($variables) {
   $element = $variables['element'];
 
-  // Usability: Prevent js errors on first visit to settings page, etc.
-  // Of course it will still error if the *wrong* key is on file.
-  if (gmap_get_key() == '') {
-    return t('Unable to render map: Google Maps API key is missing.');
-  }
-
   // Track the mapids we've used already.
   static $mapids = array();
 
diff --git a/gmap_settings_ui.inc b/gmap_settings_ui.inc
index e917498..994d25b 100644
--- a/gmap_settings_ui.inc
+++ b/gmap_settings_ui.inc
@@ -34,7 +34,7 @@ function gmap_admin_settings($form, &$form_state) {
   }
 
   $form['initialization']['googlemap_api_key']['#title'] = t('Google Maps API Key');
-  $form['initialization']['googlemap_api_key']['#description'] = t('Your personal Googlemaps API key.  You must get this for each separate website at <a href="http://code.google.com/apis/maps/signup.html">Google Map API website</a>.');
+  $form['initialization']['googlemap_api_key']['#description'] = t('Your personal Googlemaps API key.  If you want to use an API key, you can get one at <a href="http://code.google.com/apis/maps/signup.html">Google Map API website</a>.');
 
 if (file_default_scheme() != 'public') {
   $form['initialization']['gmap_private_markerfile'] = array(
-- 
GitLab