2

假设我有一个 html 表:

<table border="1">
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
</table>

使用 python 包 simplekml 将该 html 位插入 kml 弹出窗口的最简单/最佳方法是什么?

4

1 回答 1

1

刚找到。Description 和balloonstyle接受 Html 标签。

kml = simplekml.Kml(open=0) # open a file
pfol = kml.newfolder(name='foo',open=0) # start a folder
pol = pfol.newpoint(name= 'bar') # define a point
pol.balloonstyle.text = '<HTMLTABLE>' # insert html
pol.description = 'my point'
于 2017-02-28T15:17:01.230 回答