Support Center

Google Maps no longer work on my Drupal site - how can I fix that?

Last Updated: Jan 15, 2018 12:07PM EET

As of June 22, 2016, Google has changed their policy regarding the standard plan of Google Maps API as they announced in their blog post. Keyless access to the API is no longer supported.

With the above said, the older implementation of Google Maps in our themes may become unavailable.
Our current implementation of Google Maps has been enriched with a Google Maps API Key setting.

To find it, please, go to the Appearance settings of your theme and find Google Maps API Key  under the the MTT THEME SETTINGS tab:
To generate your own API Key for Google Maps, please, follow the steps described in Google's official documentation at https://developers.google.com/maps/documentation/javascript/get-api-key.

After setting your own Google Maps API Key and saving the changes, please, do not forget to clear your Drupal cache.

If the aforementioned setting is not available for your theme installation, please follow the corresponding guide below depending on the Drupal version that you are using.

Drupal 8

  1. Please follow the steps mentioned in the official Google documentation in order to generate your own Google Maps Javascript API Key. 
  2. Open the theme_name.libraries. yml file located in the root folder of your theme with your favourite text editor.
  3. Locate the google-maps library and specifically, the 5th line that mentions the Google maps API js file URL
    https://maps.googleapis.com/maps/api/js?v=3: { scope: 'footer' }
  4. Change this url by adding your key right after the v=3 like the example below
    ​https://maps.googleapis.com/maps/api/js?v=3&key=YOUR_KEY: { scope: 'footer' }
  5. Save your changes and clear your Drupal cache.

 


Drupal 7

  1. Please follow the steps mentioned in the official Google documentation in order to generate your own Google Maps Javascript API Key. 
  2. Open the template.php file located in the root folder of your theme with your favourite text editor.
  3. Locate the Google map js configuration section. Hint: Searching for ‘https://maps.googleapis.com/maps/api/js’ will point you to the correct lines
  4. Locate the specific line that contains the Google maps API js file URL. This should be similar the example below:
    drupal_add_js('https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false',array('type' => 'external', 'scope' => 'header', 'group' => 'JS_THEME'));
  5. Change this url by adding your key right after the sensor=false section like the example below:
    ​drupal_add_js('https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=YOUR_KEY',array('type' => 'external', 'scope' => 'header', 'group' => 'JS_THEME'));
  6. Save your changes and clear your Drupal cache.

Contact Us

support-agent@morethanthemes.com
http://assets0.desk.com/
false
morethanthemes
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete