问题在于 KML 结构。当 Google 地图没有时,Google 地球的 KML 结构更加灵活。
所有“样式”标签都应位于“文档”标签内和“文件夹”标签外。
这是一个简短的 KML 示例:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2">
<Document>
<name>orginal.kml</name>
<Style id="1">
<LineStyle>
<color>ffff0000</color>
<width>0</width>
</LineStyle>
<PolyStyle>
<color>9955aaff</color>
<fill>1</fill>
</PolyStyle>
</Style>
<Folder>
<name>pol_2013_M09_D10_0200_UTC_0200__L00_SO2_1HR_CONC</name>
<Placemark>
<name>17.5 - 35.0</name>
<styleUrl>#1</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#pol_2013_M09_D10_0200_UTC_0200__L00_SO2_1HR_CONC">
<SimpleData name="index">0</SimpleData>
<SimpleData name="COOD">17.5</SimpleData>
<SimpleData name="COOD_max">35</SimpleData>
<SimpleData name="VALUE">17.5 - 35.0</SimpleData>
</SchemaData>
</ExtendedData>
<MultiGeometry>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>35.09391961043328,32.69851291029587,0 35.09384988444287,32.69862535127403,0</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
<Schema id="pol_2013_M09_D10_0200_UTC_0200__L00_SO2_1HR_CONC" name="pol_2013_M09_D10_0200_UTC_0200__L00_SO2_1HR_CONC">
<SimpleField name="Name" type="string" />
<SimpleField name="Description" type="string" />
<SimpleField name="index" type="int" />
<SimpleField name="COOD" type="float" />
<SimpleField name="COOD_max" type="float" />
<SimpleField name="VALUE" type="string" />
</Schema>
</Folder>
</Document>
</kml>