[英]Google Maps Javascript API v3 Error Message “Key is Disabled”
我已經為我的網站treblecode.com生成了Google Maps Javascript API v3密鑰,並將www.treblecode.com添加到了我的開發者帳戶的引薦來源列表中。 我也嘗試過.treblecode.com /無濟於事。
但是,嘗試根據developers.google.com/maps/documentation/javascript/tutorial#api_key上的Hello World准則創建測試HTML頁面時,出現以下錯誤:
“ Google已禁止對此應用程序使用Maps API。提供的密鑰不是有效的Google API密鑰,或者未獲得該網站上Google Maps Javascript API v3的授權。如果您是此應用程序的所有者,則您可以在此處了解有關獲取有效密鑰的信息: https : //developers.google.com/maps/documentation/javascript/tutorial#api_key “
以下是我當前在測試頁上位於http://www.treblecode.com/apis/quickmap.html上的代碼:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
</style>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=REDACTED">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: { lat: -34.397, lng: 150.644},
zoom: 8
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
If it helps, my hosting provider is GoDaddy.
在這里將獲得任何幫助,因為我不確定要與該API配合使用還需要做什么。
編輯 2016年7月27日
因此,我是在不久前的某個時候說這句話的。 不再是真的。 2016年5月運行正常的網站突然停止工作。
因此,請忽略下面顯示的文字。
您不需要鑰匙。 只需加載“ https://maps.googleapis.com/maps/api/js ”
我不確定如何解決,但是我按照以下步驟進行了工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.