我需要知道什麼時候谷歌地圖是完全加載,只有然後啓用其他控件。 下一個代碼不正確,因爲每次移動地圖時都會出現「空閒」。所以我需要知道地圖只能使用一次。如何檢查Google地圖是否已完全加載?
google.maps.event.addListenerOnce(map, 'idle', function(){
// do something only the first time the map is loaded
});
這將是不錯的下一個代碼:
if map.isReady() then map.getBounds()