0
編輯:聽說谷歌,他們已經證實這是他們的問題。谷歌地圖V3 StreetView不會顯示在第二個setVisible()調用
EDIT2:我在Google的聯繫人告訴我他們已經修復了這個錯誤。
我使用谷歌地圖V3 API有一個麻煩的錯誤。
如果您設置了地圖,切換到街景,關閉街景,然後重新打開,圖像顯示爲空白(儘管控件仍顯示)。如果您點擊控件移動相機,圖像將返回。
這是什麼原因造成的?正如你可以看到下面的代碼非常簡單,我不能認爲我出錯了。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
<div id="map" style="width:500px;height:300px"></div>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(37.767063, -122.445724),
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 15
});
var streetView = map.getStreetView();
streetView.setPosition(map.getCenter());
setTimeout(function() { streetView.setVisible(true); }, 1500);
setTimeout(function() { streetView.setVisible(false); }, 3000);
setTimeout(function() { streetView.setVisible(true); }, 4500);
</script>
</body>
</html>
我已經將這個升級到了我在Google的API聯繫人,如果我瞭解到任何相關的信息,我會回報。 – 2010-07-23 21:25:32