1

我在融合表中有一个自定义信息窗口:

<div class='googft-info-window' style='font-family: sans-serif'>
<img src="{image}" width=200 align=right>
<b>ID Number:</b> {pkey}<br>
<b>Condition:</b> {stateofrepair}<br>...

但有时没有可用的 {image},这会导致大多数浏览器上的图像图标损坏。<img>如果 {image} 为空白,有没有办法可以关闭标签?

4

1 回答 1

1

使用 Fusion Tables UI 无法做到这一点。

但是您可以使用 Google Maps API 中的 Fusion Tables Layer 来执行此操作。您可以使用 Google Maps API 在图层上设置点击侦听器。您可以在单击返回的事件对象中访问与单击的特征关联的数据。此时,您可以测试图像值是否实际包含数据,如果是,则显示图像。

这是一个例子:

http://code.google.com/apis/fusiontables/docs/samples/change_infowindow_content.html

于 2012-01-24T00:26:24.993 回答