2013-05-12 86 views
0

我點擊標記時執行此代碼。除了地圖將不會在垂直跨越一切工作正常(它在橫向跨度)谷歌地圖不會垂直跨越

這是我的代碼(JavaScript)的

google.maps.event.addListener(marker, 'click', function() { 
    infoBox.setContent('<div class="info_details">'+this.image+' <h2>'+this.title+'</h2> <div class="prop_details">'+this.type+' for '+this.type2+' - '+this.price+'</div>'); 
    infoBox.open(map, this);  
    map.setCenter(this.position);  
    map.panBy(380,110); 
}); 

回答

0

設置信息框,以truedisableAutoPan - 選項,否則panBy()的調用將與infoBox的自動平移相競爭。

+0

它的工作原理 - 非常感謝:) – Crerem 2013-05-12 08:55:21