This question is answered.


Permlink Replies: 13 - Pages: 1 - Last Post: 14-Feb-2020 21:15 Last Post By: linuxrog Threads: [ Previous | Next ]
linuxrog

Posts: 179
Registered: 21-Nov-2008
Google Maps / JavaScript consol error
Posted: 12-Feb-2020 23:13
 
  Click to reply to this thread Reply
I get an error that I can not find the solution to. When viewing certain albums, a map flashes up momentarily when I open the sub-album, followed by a big "image" with the message:

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.

This does not happen for all sub-albums. Two examples:
Chisos Basin, and
Soto Vista and Santa Elena Canyon

I note that there is an entry for an API key in Sections / Map / API key box. It was, evidently, carried forward from a previous album as a default.

How do I get rid of this problem?

/Roger
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 12-Feb-2020 23:33   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
Apparently, you've told Google maps (on their site) to restrict the use of your API Key to a specific domain, but the domain of the album doesn't match that.

Can you give us a link to an album where it does work?

(This always happens on local preview, BTW, because you're not viewing the album from your domain.)
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 12-Feb-2020 23:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
It worked here, clicking on the map icon, lower-right.

Zermatt

But, after I reloaded the image. Works for other images in this album.

Actually, it's flakey there. Sometimes I see the map,sometimes, blank / black space where the map should be.

Edited by: linuxrog on 12-Feb-2020 17:48
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 00:00   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
Not working for me on that page.

And whether it's the "Oops" page or a blank frame, the console error message is the same every time:
Google Maps JavaScript API error: RefererNotAllowedMapError
To see the error message, hit F12, then go to the Console tab in the developer's tools.

And what Google says about that:

The current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key in the Google Cloud Platform Console.
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 19:29   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I am lost on how to correct this. I look at the whole error and see,
Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://bronord.com/pics/big.bend/Chisos%20Basin/index.html js:60:128
gd https://maps.googleapis.com/maps/api/js?key=AIzaSyDSD8XVzbxUvooJEr7HMSJLatUo1etXZCw:60
i https://maps.googleapis.com/maps-api-v3/api/js/39/10/common.js:75
Ip https://maps.googleapis.com/maps-api-v3/api/js/39/10/common.js:150
c https://maps.googleapis.com/maps-api-v3/api/js/39/10/common.js:69
<anonymous> https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttps://bronord.com/pics/big.bend/Chisos%20Basin/index.html&4sAIzaSyDSD8XVzbxUvooJEr7HMSJLatUo1etXZCw&callback=_xdc_._6ystfh&key=AIzaSyDSD8XVzbxUvooJEr7HMSJLatUo1etXZCw&token=59236:1

The API key is correct. web access (http) is allowed on the API consol. Might it be due to https: now being invoked rather than http. My site was updated to https access. In Google's API management, I even registered https:///www.bronord.com as an attempt to fix this.

I'm lost! The API path to showing maps with jAlbum is a rat's nest of complexity! Either that or my ole brain has withered and is close to death.

/Roger
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 19:45   in response to: linuxrog in response to: linuxrog
Correct
  Click to reply to this thread Reply
Attachment ss006612.png (33,3 KB)
Please don't blame jAlbum for this rat's nest. This is all down to Google.

In any event, maybe this will help. Attached are the settings for the API Key that I use on my demo pages. Note all of the entries, including the wildcarding on the domain name, the fact that no protocol (http vs https) is required, and the mysterious "API Restrictions" choice at the bottom - that one is not the same as restricting the key to your domain.

At least you can find the API console. I finally bookmarked mine, because I had a hell of time finding it a while back. Gee, Google, great user interface.
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 21:18   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Wasn't blaming jAlbum . . . poorly worded.

Your advice led me to the answer . . . after I re-found the "restrictions" page. The attached shows the additions that I made, with possible redundancies, but I kept adding until it worked. And, that fixed the issue with other albums, e.g., City Gate in Innsbruck.

Should I write directly to the boss and tell him to give you a raise?

Thanks for sticking with this one.

/Roger
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 21:20   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Related question: WHY do maps even appear at the beginning of some sub-albums? I did take an action that I know of to cause that to happen!

/Roger
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 21:41   in response to: linuxrog in response to: linuxrog
Helpful
  Click to reply to this thread Reply
See Tiger > Sections > Map. The default setting is to include a map section on the index page.

For maps on individual images, see Tiger > Lightbox > Info panel > Buttons > Map
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 22:03   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Ah, that fixed "it."

It is not clear to me where jAlbum picks map info from. Some of my images have GPS data, some do not. Even tho some sub-albums have some images with GPS data, the do not have folder maps generated. (Some images had GPS data because they were taken with a Google phone. Others were with a camera w/o GPS data - no GPS sensor.) Not a big deal if I turn-off the option. Just trying to understand jAlbum.

/R
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 22:09   in response to: linuxrog in response to: linuxrog
Helpful
  Click to reply to this thread Reply
That's a "Tiger thing." The jAlbum core makes the GPS coordinates available to the skin for any image that contains them. What the skin does with them after that is up to the skin developer.

In theory, Tiger should show a map with markers for all of the images in that folder that have GPS info in them, and in my quick test, that's what happens. It doesn't search into subfolders for GPS-tagged images, however - it's looking for GPS in the images at the current level.
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 13-Feb-2020 23:03   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
You are teaching me even more about the subtleties of jAlbum and its power! I never noticed the diff between the settings at two different levels.

As regards your test - results were different from mine but I'm not concerned.

Thanks again for the help.

$$$$$$

/R
JeffTucker

Posts: 6,878
Registered: 31-Jan-2006
Re: Google Maps / JavaScript consol error
Posted: 14-Feb-2020 00:22   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
linuxrog wrote:
Should I write directly to the boss and tell him to give you a raise?

They did finally give me a pony a few years ago, delivered in person by Anders in a restaurant in Manhattan.

https://jefftucker.jalbum.net/dala/
linuxrog

Posts: 179
Registered: 21-Nov-2008
Re: Google Maps / JavaScript consol error
Posted: 14-Feb-2020 21:15   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Classy!
Legend
Forum admins
Helpful Answer
Correct Answer

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