Google Maps Javascript API v3在应用程序中被禁用

时间:2014-10-21 03:51:50

标签: javascript api google-maps google-maps-api-3

我有一个使用谷歌地图api v3的应用程序(我在本地主机上运行它),今天早上每个东西运行良好,我打开我的应用程序并看到错误:Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google.com/maps/documentation/javascript/tutorial#api_key 我按照给定的链接来解决这个问题。但是,在完成这些之后:

1. Visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account.
2. Click the Services link from the left-hand menu.
3. Activate the Google Maps JavaScript API v3 service.
4. Click the API Access link from the left-hand menu. Your API key is available from the API Access page, in the Simple API Access section. Maps API applications use the Key for browser apps. 

我的应用程序没有任何变化,我仍然没有克服这个问题。所以有人可以告诉我我该怎么做。

1 个答案:

答案 0 :(得分:0)

如果您已阅读该文档,为自己创建了一个API密钥,那么在您的应用程序中,您的脚本源应如下所示:

<script src="https://maps.googleapis.com/maps/api/js?key=21a300d4a9a2cf55e4ffac1750acbc01" type="text/javascript"></script>

您只需替换“key = YOURAPIKEY”即可。这就是Google跟踪谁正在使用其服务的方式。