Google Maps Traffic Layer Troubleshooting Guide

Google recently released an update to their Maps API, which introduced a bug in the Traffic Layer functionality. Users who enable the Traffic Layer may experience numerous JavaScript errors. This guide provides steps to resolve the issue and alternative solutions for users who want to continue using the Traffic Layer.

Traffic library error

Recommended Action: Disable the Traffic Layer #

To prevent JavaScript errors caused by the Traffic Layer bug, disable this option in the Agile Store Locator plugin. Follow these steps:

  1. Log in to your WordPress Dashboard.
  2. Navigate to the Agile Store Locator plugin.
  3. Go to the Customize Map page.
  4. Locate the Traffic Layer option.
  5. Disable the Traffic Layer.
  6. Save your changes.
disable traffic layer

Disabling the Traffic Layer will eliminate the JavaScript errors until Google fixes the issue in their Maps API library.

Why Is This Happening? #

The problem originates from Google’s Maps API library, and the Agile Store Locator plugin cannot override or fix the bug directly. The best course of action is to disable the affected feature while waiting for Google to resolve the issue.

Alternative: Using the Traffic Layer with an Older Google Maps API Version #

If you still want to use the Traffic Layer, you can revert to an older version of the Google Maps API that does not have this bug. Agile Store Locator provides a hook, asl_filter_api_key, that allows you to specify the Maps library version.

Steps to Revert to an Older Maps API Version #

  1. Add the following code snippet to your WordPress theme’s functions.php file:
add_filter('asl_filter_api_key', function($api_key) {
    return $api_key . '&v=3.58'; // Replace 3.58 with the desired older version
});

Note: Using an older version of the Maps API may expose your application to other deprecated or unsupported features. Proceed with caution.

Final Notes #

We understand the inconvenience this issue may cause and are actively monitoring updates from Google. As soon as a fix is released by Google, the Agile Store Locator plugin will continue to function seamlessly with the Traffic Layer enabled. In the meantime, we recommend the above steps to avoid disruptions.

If you have any questions or need further assistance, please contact our support team.