【发布时间】:2016-01-07 05:01:09
【问题描述】:
所以我正在使用 Google Maps Javascript Api 并且目前有一个填充了圆圈的地图。我希望能够单击一个圆圈并让它打开一个包含一些信息的表格,但不确定如何执行此操作。我已经能够点击圆圈并使用它弹出一个信息框:
var contentString = city[0].toString() + ": " + city[1].toString() + " shooting(s)";
var infoWindow= new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(cityCircle, 'click', function(ev){
infoWindow.setPosition(cityCircle.getCenter());
infoWindow.open(map);
});
// });
}
我不确定如何将此信息框格式化为表格。我试过这样的事情:
var contentString = "<table width="100%" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td rowspan="2"> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>";
但这给了我错误:“意外数字”。如果有人可以提供一些帮助,将不胜感激!
【问题讨论】: