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标记,如类,作为样式标记。使用代码更为复杂且无用户。干杯