2012-12-08 23 views
0

我正在使用Google Maps API的ASP.NET网站上工作。位于google.com教程中,我需要一个google API密钥才能使其工作。我得到了那个密钥,但是每次运行我的网站时,出现以下错误:我收到了我的Google API浏览器密钥。接下来我应该做什么?

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 v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key

问题是什么?本教程没有说明如何处理API密钥。它只是说去服务和激活谷歌地图API V2获得一个关键。

谢谢!

回答

0

当您加载Google地图脚本时,是否将API密钥包含在URL中?

link在错误信息的文档:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false" 
     type="text/javascript"></script> 

用来加载脚本的链接是:

http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false 

您需要使用您的API密钥,以取代abcdef来自Google地图。

+0

aa perfect!谢谢修复了一切.. – user1438482

+1

我讨厌在游行中下雨,但Google Maps V2 [已弃用](https://developers.google.com/maps/documentation/javascript/v2/)对于新的开发,请使用[V3 ](https://developers.google.com/maps/documentation/javascript/) –

+0

@ user1438482:请点击我答案左边的复选标记,表示它回答了您的问题/解决了您的问题。它会帮助其他可能有同样问题的人。 –

相关问题