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?
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.
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.
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.
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
.
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"
On the page that appears you need to click on the "play" button to enable the API
Then you should be good to go without authorizing domains and continue working on the local machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With