Google Maps Async Error In Maps Element - Pro 6.5.5

Hi Charlie,

I have an instance where the Google Maps async problem exists, despite being up-to-date on Pro 6.5.5.

The problem exists with the Maps Element. The site also uses MEC and if the API code is active in MEC settings the maps show fine against each event, but not in the Pro elements on the Contact page (see screenshot).

Can you replicate this?

Thanks,
Christopher

I see your getting this RefererNotAllowedMapError error in the preview. It might be due to the directory protection, or you might need to change some settings in the Google Console. For the most part your page was working, but it didn’t once or twice. I see we are loading in google maps without marking our scripts as dependencies so let’s see if that helps your issue on Monday. I see the maps on your contact page, however it doesn’t look like your screenshot. Is there another page I need to look at? Have a great day.

https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error

I was getting referrer not allowed errors on a site today. It was working fine on the front end, just getting the error in Cornerstone. Checked API settings etc. All ok.
Funny thing is that it was all fine yesterday and I hadn’t made any changes today when I started getting the error. Could be a Google thing?

I have temporarily taken directory protection off the site and am getting strange results. Most of the time no map displays, but the console shows this error:

On a single occasion, the maps did suddenly appear - after a long delay and had this warning message:

In an MEC event, I get the map showing correctly, whether directory protection is on or off.

2024-08-22_15-05-31

In Cornerstone I am getting a new error, which was not present yesterday.

As @spedney said, a new Google thing?

I will leave directory protection off till the morning.

It could be a Google thing. It’s inside of an iframe when it’s in the Cornerstone so there could be some hiccups there if the “referrer” issue is the culprit. I’m not experiencing this unfortunately on my sites.

Is there any other settings you have setup here or is this pretty much what your API key setup looks like?

The API key looks much like yours:

This is one of the few sites where I am using the maps element. Most are embedded Google Maps, or via MEC, where there is no problem, as we have seen.

I forgot to press save on my google credentials, but I see it now.

I found adding in *:// before my domain ended up fixing this in the Cornerstone preview. Does this help for you?

image

Yes, that works in CS preview - thank you. However, the all important frontend continues to display blank spaces.

My key looks like this:

The final key explicitly allows the direct page URL.

I even tried removing all custom contents of ‘functions.php’ (a busy site!) and there was (thankfully) no difference.

The maps will still not display through the public view on the frontend.

Let me know if you still have an issue after the update to 6.5.6. I don’t think MEC or WooCommerce should be an issue, but I’ll take another look at your site if 6.5.6 doesn’t fix the issue. Have a great day.

6.5.6 has fixed the issue. Many thanks Charlie!

1 Like