Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript error in Google Maps API v3 (RefererDeniedMapError)

We were using Google Maps without key and because of our traffic increase we had to create and add the API key in our JS call. But now, when we are calling the JS we are receiving this error:

RefererDeniedMapError: https://developers.google.com/maps/faq#errorcodes

In the documentation we don't see more information related to this error. With the same API key we don't have any problem to show the map in our other domains, only we have the problem in one.

Playing with the allowed referrers we have discarded problems of configuration and we don't know if maybe our domain could be banned.

The billing information was added too.

Does anyone have an idea?

Thanks!

like image 336
GusB Avatar asked Jun 22 '15 13:06

GusB


1 Answers

I’ve found an URL to your website in google’s thread and I was able to reproduce this problem locally. I’ve just added your host name in hosts file and addressed it to localhost. I’ve got the same error. It’s definitely domain name related problem.

I was able to make map works only using IP and path to a map page, instead of domain name, like:

   <!DOCTYPE html>
   <html>
     <head>
       <title>A page where should be a map</title>
     </head>
     <body>
       <iframe src='http://127.0.0.1/mapa.html'></iframe>
     </body>
   </html>

You could try to disable IP to domain name redirection (as you have now), and use your IP in the example above. It’s not a pure solution, but at least you can have a map on your website.

like image 164
Alexander Schwarzman Avatar answered Oct 30 '22 13:10

Alexander Schwarzman