Google地图是否尊重< BalloonStyle>在KML中定义? [英] Does Google Maps respect the <BalloonStyle> definition in KML?
问题描述
我正在使用GGeoXml对象将KML覆盖在嵌入式Google地图上.我需要为地标自定义弹出气球,因此我尝试使用
I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the <BalloonStyle>
element:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="http://earth.google.com/kml/2.0">
<name>Concessions</name>
<Style id="masterPolyStyle">
...
<BalloonStyle>
<text>
<![CDATA[
<h6>Concession</h6>
<h4>$[name]</h4>
<p>$[description]</p>
]]>
</text>
<displayMode>default</displayMode>
<bgColor>DDA39B81</bgColor>
</BalloonStyle>
</Style>
...
</Document>
这在Google Earth中可以正常工作,但是嵌入式地图API似乎完全忽略了这一点.我想我可以完全不使用<name>
元素,而只需将HTML中的所有内容都放在<description>
元素中,但是我希望能够利用
This works as expected in Google Earth, but the embedded map API appears to ignore this altogether. I suppose I could just leave out the <name>
element altogether and just put everything in HTML inside the <description>
element, but I'd like to be able to take advantage of the <ExtendedData>
element to display custom data in a structured way.
推荐答案
不,就像您提到的那样,描述中的html是我知道可以通过kml/georss feed控制气球样式的唯一方法.
No, like you have mentioned, html in the description is the only way I know that you can control the style of balloons through kml/georss feed.
这篇关于Google地图是否尊重< BalloonStyle>在KML中定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!