Google 地图中的 KML 气球高度样式
我试图限制以下 KML 中的描述气球高度,以便与 Google 地图一起使用。在 Google 地球中,这是通过使用 div 包装器的样式元素来实现的,因此以下 KML 工作正常。但是,当通过 Google 地图引用时,高度属性会被删除,从而在单击制作者时会出现一个大气球。
<?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark>
<name>Test Mark</name>
<description>
<![CDATA[
<div style="height:150px;overflow:auto">
<table>
<tr><td>Row 1</td><td>some data</td></tr>
<tr><td>Row 2</td><td>some data</td></tr>
<tr><td>Row 3</td><td>some data</td></tr>
<tr><td>Row 4</td><td>some data</td></tr>
<tr><td>Row 5</td><td>some data</td></tr>
<tr><td>Row 6</td><td>some data</td></tr>
<tr><td>Row 7</td><td>some data</td></tr>
<tr><td>Row 8</td><td>some data</td></tr>
<tr><td>Row 9</td><td>some data</td></tr>
<tr><td>Row 10</td><td>some data</td></tr>
<tr><td>Row 11</td><td>some data</td></tr>
<tr><td>Row 12</td><td>some data</td></tr>
<tr><td>Row 13</td><td>some data</td></tr>
<tr><td>Row 14</td><td>some data</td></tr>
<tr><td>Row 15</td><td>some data</td></tr>
<tr><td>Row 16</td><td>some data</td></tr>
<tr><td>Row 17</td><td>some data</td></tr>
<tr><td>Row 18</td><td>some data</td></tr>
<tr><td>Row 19</td><td>some data</td></tr>
<tr><td>Row 20</td><td>some data</td></tr>
<tr><td>Row 21</td><td>some data</td></tr>
<tr><td>Row 22</td><td>some data</td></tr>
<tr><td>Row 23</td><td>some data</td></tr>
</table>
</div>
]]>
</description>
<Point>
<coordinates>1,23</coordinates>
</Point> </Placemark> </kml>
在我的项目中,我在气球描述中创建的表格可能会很长,因此我需要使气球内容可滚动。
I'm trying to limit the description balloon height in the following KML for use with Google Maps. In Google Earth, this is achieved by using the style element of a div wrapper, so the following KML works fine. However, when referenced via Google Maps, the height attribute is stripped out resulting in a large balloon when the maker is clicked.
<?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark>
<name>Test Mark</name>
<description>
<![CDATA[
<div style="height:150px;overflow:auto">
<table>
<tr><td>Row 1</td><td>some data</td></tr>
<tr><td>Row 2</td><td>some data</td></tr>
<tr><td>Row 3</td><td>some data</td></tr>
<tr><td>Row 4</td><td>some data</td></tr>
<tr><td>Row 5</td><td>some data</td></tr>
<tr><td>Row 6</td><td>some data</td></tr>
<tr><td>Row 7</td><td>some data</td></tr>
<tr><td>Row 8</td><td>some data</td></tr>
<tr><td>Row 9</td><td>some data</td></tr>
<tr><td>Row 10</td><td>some data</td></tr>
<tr><td>Row 11</td><td>some data</td></tr>
<tr><td>Row 12</td><td>some data</td></tr>
<tr><td>Row 13</td><td>some data</td></tr>
<tr><td>Row 14</td><td>some data</td></tr>
<tr><td>Row 15</td><td>some data</td></tr>
<tr><td>Row 16</td><td>some data</td></tr>
<tr><td>Row 17</td><td>some data</td></tr>
<tr><td>Row 18</td><td>some data</td></tr>
<tr><td>Row 19</td><td>some data</td></tr>
<tr><td>Row 20</td><td>some data</td></tr>
<tr><td>Row 21</td><td>some data</td></tr>
<tr><td>Row 22</td><td>some data</td></tr>
<tr><td>Row 23</td><td>some data</td></tr>
</table>
</div>
]]>
</description>
<Point>
<coordinates>1,23</coordinates>
</Point> </Placemark> </kml>
Here is how the KML looks in Google Maps
In my project, it is feasible that the tables I'm creating in the balloon description's could be quite long, so I need to make the balloon contents scrollable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将高度替换为最大高度,如下所示:
Just swap height for max-height like so: