Google API Key - oops

Hi - I started this about a year ago, finally go back to it, did all the updates and now im having issues with the google maps short code i guess. In the javascript console it says that i’ve added the API key too many times, and then follows up with no api key specified… i’m confused and no idea where to start.

https://barronhvac.ca/ is the site.

you can see in the footer that i get a “This page didn’t load Google Maps correctly. See the JavaScript console for technical details.”

any help or direction would be appreciated.

Jules

Hi Jules,

There’s an update in Google MAP API and API key is now required. See this on how to get API key: https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

Then see this thread on how to include APIkey parameter on the map shortcode: https://theme.co/apex/forum/t/sorry-something-went-wrong-google-map-shortcode/5988/5

Hope this helps.

Hi - thanks for the reply.

I’ve attempted to do what you posted - but it appears the [**x_**google_map] shortcode doesn’t work for me. It simply renders the full body. I added the api_key attribute into the [google_map] short code - and it worked.

thanks.

Jules

Sorry… still a bit of an issue - the maps show up now, but if you open up the console you’ll see errors thrown about multiple api keys included as well as prototype not found:

You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
js:96:295
bh
https://maps.googleapis.com/maps/api/js:96:295
<anonymous>
https://maps.googleapis.com/maps/api/js:134:75
...

as well as other issues:

TypeError: a is undefined
js:76:412
_.yf
https://maps.googleapis.com/maps/api/js:76:412
w0
https://maps.googleapis.com/maps-api-v3/api/js/30/13/stats.js:3:456
<anonymous>
https://maps.googleapis.com/maps-api-v3/api/js/30/13/stats.js:8:141
Rc.prototype.jb/</d[a]<
...

These seem to cause the map to throw errors when you hover over it, and the one on the contact page is non responsive / interactive.

any additional help would be great.

Thanks,

Jules

Hi There,

Upon checking, I see that you’re not fully updated. Could you please update your X theme and then purge your server cache and test your site again.

Let us know how it goes.
Thanks!

Hi - I’ve updated to the latest - i’m not sure how you ‘purge server side cache’ to be honest, but I’m still getting the issue.
I have the child theme installed and activated as well if that gives any help?

thanks,

Jules

Hi There,

You only need to purge cache if you’re using a caching plugin. Would you mind providing us with login credentials so we can take a closer look? Please provide following information:

Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password

Thanks!

Hi - sure here you go - no there is no caching plugin BTW.

Hey @spankycarbowski,

It’s because of your custom function.

I commented it out and the error is gone.

Please remove custom functions to test if they are causing issues before posting for support next time.

Thanks.

Wow - forgot i even did that!
thank you very much for the help!

Glad that we could be of a help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.