Title: [Problem] Map is a gray rectangle
Last modified: May 16, 2017

---

# [Problem] Map is a gray rectangle

 *  Resolved [DavidLopesC](https://wordpress.org/support/users/davidlopesc/)
 * (@davidlopesc)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/)
 * Hi!
 * I really like this plugin, well done.
    Can you please help me with an issue:
 * For some reason my map is all gray, as you can see on this page (LOCATION TAB):
   
   [http://www.arrabidaseaventures.com/index.php/tour-item/dolphin-watching/](http://www.arrabidaseaventures.com/index.php/tour-item/dolphin-watching/)
 * Tried a lot of things and can’t figure this out. Do you have any clue?
 * Thanks a lot,
    David Cardoso
    -  This topic was modified 8 years, 12 months ago by [DavidLopesC](https://wordpress.org/support/users/davidlopesc/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9138360)
 * HI there,
 * Right now I’m seeing that the site can’t connect to the database correctly.
 * But generally, the grey background means you don’t have a Maps API key configured.
   Here’s our docs on doing that:
    [https://wordimpress.com/documentation/maps-builder-pro/creating-maps-api-key/](https://wordimpress.com/documentation/maps-builder-pro/creating-maps-api-key/)
 * Review that (after you get your database worked out!) and let me know if you 
   have other questions.
 * Thanks!
 *  Thread Starter [DavidLopesC](https://wordpress.org/support/users/davidlopesc/)
 * (@davidlopesc)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9138450)
 * Hi!
    Thanks a lot for your reply. Actually it has some connection problems but
   a refresh or some waiting seconds let you visit the site correctly. I’ve tried
   the API key many times and doesn’t look that hard to set up.. I’m not 100% sure
   if I did everything right but I guess so.
 * Can you detect the problem?
    Thanks a lot for your help!
 * Best regards,
    David Cardoso.
 *  Plugin Author [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9138546)
 * I see. The issue is that the map is hidden on page load, so the JS doesn’t have
   a chance to “draw” the map. You’ll need to re-trigger our JS when that tab is
   clicked.
 * Add this snippet at the bottom of your theme’s functions.php file, and you should
   be all set:
 *     ```
       add_action('gmb_public_view_bottom', 'wordimpress_redraw_gmb_tab_script');
   
       function wordimpress_redraw_gmb_tab_script() { ?>
           <script>
           jQuery(document).ready(function ($ ) {
       		$('li.mkdf-tour-nav-item a').one('click', function (e) {
       			var panel_id = $(this).attr('href');
       			setTimeout(function () {
       				var panel = $(panel_id).get(0);
       				MapsBuilder.load_hidden_map(panel);
       			}, 100, panel_id);
       		});
       	});
           </script>
       <?php
       }
       ```
   
 * Thanks!
 *  Thread Starter [DavidLopesC](https://wordpress.org/support/users/davidlopesc/)
 * (@davidlopesc)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9142856)
 * Hi.
 * Amazing.. quick reply and fixed it.
    Thanks a lot for you time and skill!!
 * David Cardoso
 *  Plugin Author [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9142899)
 * Glad to hear, happy to help.
 * If you’re enjoying Maps Builder and appreciate our support, we’d love a kind 
   review from you here:
    [https://wordpress.org/support/plugin/google-maps-builder/reviews/](https://wordpress.org/support/plugin/google-maps-builder/reviews/)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Problem] Map is a gray rectangle’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-maps-builder_f9f9f9.svg)
 * [Maps Builder - Google Maps Plugin](https://wordpress.org/plugins/google-maps-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-maps-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-maps-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/google-maps-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-maps-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-maps-builder/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/problem-map-is-gray-background/#post-9142899)
 * Status: resolved