Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NotLoadingAPIFromGoogleMapsError even when loading correct URL

I am getting the NotLoadingAPIFromGoogleMapsError error for some users even if the correct URL is being used: (pug syntax):

script(type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places')

It seems to be resulting from the Authentication API call generated from the script. Anyone else have this issue? How did you solve it?

like image 565
itamar Avatar asked Jan 15 '19 19:01

itamar


People also ask

How do I get rid of this page Cannot load Google Maps correctly?

You can do that by accessing Application restrictions, then navigate to “HTTP referrers” then type in your domain's name. After making the necessary changes, click Save. Copy the API key because you will need it to get the map back on your website.

Why is Google Maps not working on my website?

You may need to update your Google Maps app, connect to a stronger Wi-Fi signal, recalibrate the app, or check your location services. You can also reinstall the Google Maps app if it isn't working, or simply restart your iPhone or Android phone. Visit Business Insider's homepage for more stories.

Why isn't my Google Maps API working?

There are a several reasons why your google maps may not be working, the most common issue being no Google Map API key set or set incorrectly. To use the Google Maps JavaScript API, you must register your app project on the Google Cloud Platform Console and get a Google API key which you can add to your app.


2 Answers

Hopefully others will find this useful - I received an answer from Google as follows:

The API session token expires if someone leaves a map open for more than about 24 hours, so it's normal to see a low level of these errors. (This is the intended behavior)

There's no documentation about this anywhere - so hopefully this answer will help save people research time.

There might be a way to catch the error and re-authorize if it occurs. I'll update here if that's a possibility.

like image 156
itamar Avatar answered Nov 08 '22 15:11

itamar


I had this issue for my site before and it was because of my service worker cache the google map API script. Once I unregistered my service worker the error stopped.

like image 31
Yen Avatar answered Nov 08 '22 13:11

Yen