Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API DeletedApiProjectMapError

I have the exact same problem like Arul.

I am trying to use Google Maps API on my webpage but when I try to implement the map I've got DeletedApiProjectMapError.

First I went to the Error Messages site after I've tried many ways to include the script, like:

<script src="http://maps.googleapis.com/maps/api/js?v=3&key=API_KEY"></script>   //or <script src="http://maps.googleapis.com/maps/api/js?key=API_KEY"></script>  //or <script src="http://maps.googleapis.com/maps/api/js"></script> 

and tried to add new API key on the Dev site but none of them works.

Is it possible that the error isn't on my side but on Google's?

like image 711
balintbabics Avatar asked Jul 05 '16 09:07

balintbabics


People also ask

Is Google Maps API free?

The API is available for developers that have a free Google Maps API key. Usage of the API is not strictly free, but they do offer $200 of free monthly usage for most users. The pricing scales to fit your particular needs and you are only charged for your API usage.

How do I fix InvalidKeyMapError?

Deleting the existing key and regenerating a new key worked for me. Show activity on this post. InvalidKeyMapError happens when your API key can't be found. So make sure you are using correct key that you generate or regenerate it.

Why is my Google Maps API key not 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

I have found the solution to the problem.

You need to enable both the Google Maps Javascript API, and the Geocoding API.

https://console.developers.google.com/projectselector/apis/library

and

https://console.developers.google.com/google/maps-apis/apis/geocoding-backend.googleapis.com

Afterwards the error was RefererNotAllowedMapError instead of DeletedApiProjectMapError, but that was because I was running it on localhost - and it worked on the actual site after I added the domain in Credentials -> Domain Verification.

like image 85
balintbabics Avatar answered Sep 19 '22 19:09

balintbabics


Just to add to the reply above with an image (and this solution worked for me while still staying on the local machine), because I was a bit confused about the enabling of APIs part.

Just navigate to: https://console.developers.google.com/projectselector/apis/library

Select your project (for which you have an API)

On the right side expand the Maps API section and click on "Google Maps Javascript API" and the "Geocoding API" enter image description here

On the page that appears you need to click on the "play" button to enable the API

enter image description here

Then you should be good to go without authorizing domains and continue working on the local machine.

like image 26
Robert Sinclair Avatar answered Sep 18 '22 19:09

Robert Sinclair