2015-10-19 39 views
0

我有一個使用Google Maps API的應用程序。直到最近它還沒問題,但現在(過去3周左右)停止了工作。我沒有對代碼做任何修改,所以我認爲這個改變是在谷歌方面。Google地球API停止工作 - 顯示頁面,但沒有地圖

我試圖讓它再次運行,但我沒有贏。頁面加載,但不顯示地圖(它只顯示控件)。我已經將代碼減少到了最低限度(即刪除了所有丟棄的引腳並返回座標代碼),但我仍然卡住。我也沒有收到任何錯誤消息。

這裏提供的代碼是淡化版本,我試圖只保留基本知識。它使用Delphi XE5(VCL)編寫,並使用帶有以下HTML腳本的Webbrowser組件。在定義MY_KEY的地方,我使用Google的API密鑰:

<!DOCTYPE html> 
<html> 
    <head> 
    <style type="text/css"> 
<!--  html, body { height: 100%; margin: 0; padding: 0; } 
     #map { height: 100%; } --> 
    </style> 
    </head> 
    <body> 
    <div id="map"></div> 
    <script type="text/javascript"> 

var map; 
function initMap() { 
    map = new google.maps.Map(document.getElementById('map'), { 
    center: {lat: -34.397, lng: 150.644}, 
    zoom: 8 
    }); 
} 
    </script> 
    <script async defer 
     src="https://maps.googleapis.com/maps/api/js?Key=MY_KEY&callback=initMap"> 
    </script> 
    </body> 
</html> 

任何幫助將不勝感激!

請參閱所附截圖Reduced software where Google Maps don't show

回答

相關問題