我通过 geoxml3 解析一个 kml 文件,其中地标具有扩展数据字段。使用 kmz 分支中的 geoxml.js (尝试在此处遵循解决方案:Load kml extendeddata into variable with Geoxml3),我仍然发现 geoXmlDoc.gpolylines[0].title 有效,但 geoXmlDoc.gpolylines[0].vars.val未定义。地标格式供参考:
<Placemark>
<name>Left to Right</name>
<description><![CDATA[One Way: True<br>Crossing: false<br>Closure: True]]></description>
<styleUrl>#line-000000-1200</styleUrl>
<ExtendedData>
<Data name="One Way">
<value>True</value>
</Data>
<Data name="Crossing">
<value>0</value>
</Data>
<Data name="Closure">
<value>True</value>
</Data>
</ExtendedData>
<LineString>
<tessellate>1</tessellate>
<coordinates>
115.8350241,-31.928985,0
115.8409465,-31.9267996,0
115.8470404,-31.9297863,0
115.8533061,-31.9272367,0
</coordinates>
</LineString>
</Placemark>