2009-06-19 84 views
2

描述此問題的最佳方法是使用鏈接。請訪問此頁:Ruby International | APOAds.comGoogle地圖GDirections - IE7中沒有居中/放大縮小圖

在FireFox中,一切正常。在IE中加載方向,但不集中於它們。也許這只是我的個人電腦,它是否在IE瀏覽器下工作?

這裏的JavaScript做的工作首當其衝:

$(function() { 
    // panorama of business 
    var biz = new GLatLng(35.796532,139.406645); 
    panoramaOptions = { latlng:biz }; 
    myPano = new GStreetviewPanorama($("div#geoMap").get(0), panoramaOptions); 

    // get map for directions 
    var dirMap = new GMap2($("div#dirMap").get(0)); 
    dirMap.setCenter(new GLatLng(35.740066,139.347582), 12); 
    dirMap.setUIToDefault(); 

    // load directions 
    directions = new GDirections(dirMap, $("div#dirMapText").get(0)); 
    directions.load("from: [email protected],139.347582 to: Ruby [email protected],139.406645"); 

    $("#tabs").tabs({ cookie: { expires: 30 } }); 
}); 

任何幫助是極大的讚賞。 (人)

+0

from yokota air base? – 2009-06-19 12:23:48

+0

這是正確的。 :D – Chaddeus 2009-06-19 12:32:34

+0

很酷。我在東京。不要經常到橫田出去,但是這是一個很好的地方。摩托車,對不起。沒有汽車:( – 2009-06-19 12:37:49

回答

3

更新:在初始化標籤之前,您正在調用您的路線功能 - 但在指示請求回到瀏覽器時,標籤已被初始化,並且請求在IE中被玷污。您可以通過使用second suggestion here來修復它 - 設置一個偵聽器,在單擊該選項卡時調用您的路線功能。

$('#tabs').bind('tabsshow', function(event, ui) { 
    if (ui.panel.id == "tabs-5") { 
     directions = new GDirections(dirMap, $("div#dirMapText").get(0)); 
     directions.load("from: [email protected],139.347582 to: Ruby [email protected],139.406645"); 
    } 
}); 
0

奇怪的問題,但你有沒有嘗試過最後一次撥打setCenter

相關問題