开发者

How to give a style to google map bubble with openInfoWindowTabsHtml?

开发者 https://www.devze.com 2023-01-17 17:28 出处:网络
I am using google map for my site. I have used the following code function addMarker(latitude , longitude, infoTabs)

I am using google map for my site. I have used the following code

function addMarker(latitude , longitude, infoTabs)
{


    if(typeof(iconImage) !== 'undefined')
    {
    var icon = new GIcon();
    icon.i开发者_JAVA百科mage = 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); }

I have passed Name of the company for "infoTabs". Company name may be very short or long one. I found that i can define selectedTab and maxWidth for openInfoWindowTabsHtml() function. Is it possible to make bubble size auto, small for short and big bubble for long company name or is bubble fixed? Any help will be appreciated. Thanks in advance.


The best solution is use standards css markups like class in your code loaded with site styles or inside the bubble code as styles markup. Use code is more complex and userless. Cheers.

0

精彩评论

暂无评论...
验证码 换一张
取 消