2010-09-28 80 views
0

我正在使用谷歌地圖爲我的網站。我已經使用以下代碼如何使用openInfoWindowTabsHtml爲谷歌地圖泡泡賦予風格?

function addMarker(latitude , longitude, infoTabs) 
{ 


    if(typeof(iconImage) !== 'undefined') 
    { 
    var icon = new GIcon(); 
    icon.image = iconImage; 
    icon.iconSize = new GSize(35, 35); 
    icon.iconAnchor = new GPoint(14, 35); 
    icon.infoWindowAnchor = new GPoint(14, 14); 

    var marker = new GMarker(new GLatLng(latitude, longitude),icon); 
    } 
    else 
    var marker = new GMarker(new GLatLng(latitude, longitude)); 

    marker.openInfoWindowTabsHtml(infoTabs,{ 
       selectedTab:0, 
       maxWidth:350 
       }); 

    GEvent.addListener(marker, 'click', 
    function() { 

       marker.openInfoWindowTabsHtml(infoTabs,{ 
       selectedTab:0, 
       maxWidth:350 
       }); 
    } 
    ); 
    map.addOverlay(marker); } 

我已通過「infoTabs」的公司名稱。公司名稱可能很短或很長。我發現我可以爲openInfoWindowTabsHtml()函數定義selectedTab和maxWidth。是否有可能使泡沫大小自動化,對於長公司名稱來說是短暫的還是大泡沫的小泡沫還是泡沫固定的?任何幫助將不勝感激。提前致謝。

回答

0

最好的解決方案是使用標準的css標記,比如加載了網站樣式的代碼中的class或者樣式標記中的氣泡代碼。使用代碼更加複雜和無用戶。乾杯。