Troubleshooting Google Maps

Is your website unable to load Google Maps or do you see events located in the ocean off the coast of Africa? These are a few of the common Google Maps issues that we see. Here are our steps for troubleshooting Google Maps.

The issue may be that you haven’t hit the “Enable Google Maps” checkbox on the backend, under Events > Settings.

Screentshot: Events > Settings > Map Settings > Enable Google Maps

Once enabled, you’ll have the option to embed Google maps in your frontend event listings.

By default, The Events Calendar will try to add a map to single event views as well as an external link to Google Maps. It's possible to disable either or both these things using the settings provided in the events editor. Here's what those settings look like:

Google Maps location

Google Maps settings in Classic Editor

Google Maps settings in Block Editor

Add a Google Maps API Key

Before you go any further, please ensure you have followed the steps outlined in our article explaining how to add a Google Maps API key. A valid key is required for maps to display correctly.

Fix Venue Data

If Events Calendar PRO detects broken or missing venue data, it will let you know via an admin screen notification. This notice will provide a link to a tool, which you can find in the Map Settings section of the Events > Settings screen, that can be used to repair your venue data. Look for a button that says “Fix venues data.” Please click it, refresh your Map View and see if that makes a difference. Fixing Venue Data is a tool only available if broken data is detected.

Using Coordinates

If the last step worked, great! If not, there's another route we can go.

This time, navigate to Events > Venues. If you click Edit on one of the venues, there is an option to use latitude and longitude coordinates. Click on that option for each venue. Confirm the coordinates, save the venue, and then see if that makes a difference in the map's appearance.

Screenshot of Events editor, Venue information, Use latitude + longitude when showing Google Maps

Entering the latitude and longitude of the venue allows The Events Calendar to communicate specific coordinates to the Google Maps API when the API is unable to recognize an address on its own.

Testing for Conflicts

If the earlier steps didn't resolve the issue for you, the next step is Testing for Conflicts to determine if another plugin or theme may be contributing to the problem.

It is also worth checking for Javascript errors. See: Using Your Browser to Diagnose JavaScript Errors for help.

You might notice Google Maps has a Javascript error, such as:

You have included the Google Maps API multiple times on this page. 
This may cause unexpected errors.

You may be able to resolve this by either deactivating the other plugins or themes that are using Google Maps on your site or by dequeuing the Javascript for Google Maps within Events Calendar Pro by adding the following to your child theme's functions.php file.

Map View

The Events Calendar Pro Map View uses Google Maps to display upcoming events

Map View is one of the advanced views available with Events Calendar PRO. When enabled, a giant map displays above the main calendar and displays upcoming events that have venues assigned to them.

Visualizing events on a map is great, but we see an issue every now and then where the map shows no events and is centered off the coast of Africa. That's enough to make anyone wonder what is wrong, so we have a couple of ways to help troubleshoot and resolve the issue.

Map View No Events

Does your Map View display no upcoming events? It's important to understand that Map View uses the Google Maps API to place venues on the map. Differences between The Events Calendar event entries and map displays can still happen. These differences are likely a communication issue between the data in WordPress and how the Google Maps API is interpreting it.

You might think that the event list would show events, even if the map above it does not show any. If the Google Maps API returns no results, then the list of upcoming events will be empty as well.

Map View is also limited to only events with an assigned venue. If an event does not have a venue with a valid address, then it will not display in the list of upcoming events. This may happen even though it might be an upcoming event in other views, such as List or Month View.

Map View off the coast of Africa

Events located in the ocean off the coast of Africa are rare, and likely not your desired result. Often this happens if you do not have a venue that Google can recognize. Please refer to the earlier tips on fixing venue data or using latitude & longitude.

If you'd like the default location to be closer to your location, you can center the map in a different location. 0,0 is a latitude and longitude location centered off the coast of Africa, and the default location when no other coordinates are available. The 0,0 comes from /wp-content/plugins/events-calendar-pro/src/Tribe/Templates/Map.php. It happens because your Map View says there are “There were no results found.”

You can customize the map default location using this snippet:

Clearing the Cache

If the above steps haven't resolved things and you are using a caching plugin, please try clearing your cache: otherwise, there may be a delay before you see the results of any changes that you have made.

Wrapping Up

We hope this article has helped you to resolve any problems you might have experienced with our Google Maps integration but, if not, please do hit us up at our help desk and we’d be happy to investigate further.