This question is answered.


Permlink Replies: 4 - Pages: 1 - Last Post: 27 Dec 25, 19:41 Last Post By: JeffTucker
GHammer

Posts: 39
Registered: 28-Jul-2006
Cross-Origin Request Blocked
Posted: 27 Dec 25, 19:03
 
  Click to reply to this thread Reply
When clicking the location icon on any image using Story or Tiger skins, I get "Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details."

Checking the console I see the Cross-Origin error.

I'd think it is something newish in browsers, Safari, Firefox, and Chromium all give the same error. I don't recall seeing this error in the past, but couldn't say when it started as I just saw it today after adding new content to the album.

I have attempted to correct this by adding to the virtual site in apache2
Header set Access-Control-Allow-Origin "*"

Check apache config, restart apache, CTL-F5 the browser, go to a different folder and image.

Still get the error, no map shown.

How can I correct this? We do like the map function.
JeffTucker

Posts: 8,222
Registered: 31-Jan-2006
Re: Cross-Origin Request Blocked
Posted: 27 Dec 25, 19:30   in response to: GHammer in response to: GHammer
Correct
  Click to reply to this thread Reply
On your site, I'm not getting a cross-origin error. What I'm seeing, instead, is a "referrer not allowed" error. This is usually caused by the API key being restricted to only a certain domain, but without specifying it fully.

Head for the Google API console:

https://console.cloud.google.com/apis/credentials

Take a look at your API key. The domain restriction, to cover all bases, should look like this:
*.example.com/*
example.com/*
If you change it, give it 15 minutes or so to "take" before testing again.
JeffTucker

Posts: 8,222
Registered: 31-Jan-2006
Re: Cross-Origin Request Blocked
Posted: 27 Dec 25, 19:32   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
And now, it seems to be working properly! :)
GHammer

Posts: 39
Registered: 28-Jul-2006
Re: Cross-Origin Request Blocked
Posted: 27 Dec 25, 19:36   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thanks!

It seems that the API use has changed greatly since I first got a key.
Odd how reading the docs can solve many a issue...
JeffTucker

Posts: 8,222
Registered: 31-Jan-2006
Re: Cross-Origin Request Blocked
Posted: 27 Dec 25, 19:41   in response to: GHammer in response to: GHammer
 
  Click to reply to this thread Reply
RTFM should be used only as the absolute, desperate last resort.

Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums