Google Maps API DeletedApiProjectMapError

旧街凉风 提交于 2019-11-30 06:42:59

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/38199452/google-maps-api-deletedapiprojectmaperror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!