2009-06-19 80 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

相关问题