2015-09-16 63 views
0

當我包括我的網頁下面的代碼瀏覽器的API密鑰:谷歌地圖使用Javascript - API密鑰無效或網站未授權

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBvjzyCJmLPnsrBjMXy1RTaRqZzTCtqZgw"></script> 

我得到的錯誤:

This page was unable to display a Google Maps element. The provided Google API key is invalid or this site is not authorized to use it. Error Code: InvalidKeyOrUnauthroizedURLMapError

在Google Developers Console中,我訪問了API & auth-> Credentials->接受來自這些HTTP引用(網站)的請求...然後輸入*.mywebsite.com/*。我在這裏做錯了什麼?

+0

可能重複[谷歌地圖錯誤:InvalidKeyOrUnauthorizedURLMapError(http://stackoverflow.com/questions/29571750/google-map-error-invalidkeyorunauthorizedurlmaperror) – geocodezip

回答

1

我相信你鏈接不正確。 嘗試:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.22&key=yourkey"></script> 
+0

仍在運行到同一問題作出後更改:( – Bxx

+0

如果您刪除密鑰並僅使用https://maps.googleapis.com/maps/api/js?v=3.22作爲源代碼,那該怎麼辦? –

+0

這可行,但我會盡量減少免費配額,並且需要與api密鑰 – Bxx

相關問題