2012-12-08 22 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:請點擊我答案左邊的複選標記,表示它回答了您的問題/解決了您的問題。它會幫助其他可能有同樣問題的人。 –

相關問題