从InfoBubble,Google Maps API v3中删除标题标签

时间:2012-12-10 21:01:10

标签: javascript google-maps-api-3 infobubble

我正在使用InfoBubble,我似乎无法从InfoBubbles中获取实际的标签/标题。你如何隐藏标签?为了清楚起见,我指的是泡泡顶部的实际标签,而不是整个内容区域。

我可以查看一个示例,还是一些涵盖此内容的文档?

我认为必须是因为InfoBubble向导上显示的标签是免费的,但是当我查看源代码时,我看不到HOW。 (http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html/)

如果重要的话,这是我的地图:http://jsbin.com/ugabaz/3/

谢谢!!!!

2 个答案:

答案 0 :(得分:1)

您使用的InfoBubbles旨在使用标签,这就是它们的全部内容......

查看此处的示例:http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html/

我没有看到没有标签,或没有任何方法可以没有。

如果您只是想要一个未被删除的弹出窗口,那么为什么不使用标准infowindow来显示信息呢?毕竟这就是它的意思。

无论如何,如果你必须以两种方式隐藏tab

首先,只需将空字符串传递给制表符标题参数即可。这将停止显示文本,但您仍然会得到一个小方块。

即。 ethiopiaInfoBubble.addTab('', ethiopiaContentString);

其次,您可以编辑InfoBuble代码,以便内联css隐藏选项卡。

特别是编写以下元素的代码......

<div style="float: left; position: relative; cursor: pointer; background-color: rgb(127, 21, 66); border-width: 1px 1px 0px; border-style: solid; border-color: rgb(127, 21, 66); padding: 7.5px 15px 8.5px; margin-right: -15px; white-space: nowrap; border-top-left-radius: 0px; border-top-right-radius: 0px; z-index: 100; display: inline;" class=" _ibani_1563"></div>

应该简单输出......

<div style="display: none;" class= " whatever"></div>

答案 1 :(得分:1)

使用一些库你可以使用一些css来解决这个问题 - 这里的问题是它没有给标签提供一个好名字或类或任何东西来通过css选择器获得。

但你可以作弊!

ethiopiaInfoBubble.tabsContainer_.style['display'] = 'none'; // like this

这里我们使用infoBubble自己的指向容器容器的dom节点的指针,并强制它显示为none。