Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用openInfoWindowTabsHtml为google地图气泡添加样式?_Javascript_Google Maps - Fatal编程技术网

Javascript 如何使用openInfoWindowTabsHtml为google地图气泡添加样式?

Javascript 如何使用openInfoWindowTabsHtml为google地图气泡添加样式?,javascript,google-maps,Javascript,Google Maps,我正在使用谷歌地图为我的网站。我使用了以下代码 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 GP

我正在使用谷歌地图为我的网站。我使用了以下代码

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。是否有可能使气泡大小的汽车,小的短和大的气泡长公司名称或泡沫是固定的?任何帮助都将不胜感激。提前感谢。

最好的解决方案是在加载站点样式的代码中或在冒泡代码中使用标准css标记,如类,作为样式标记。使用代码更为复杂且无用户。干杯