Google地球导出的KMZ文件不包含网址属性

时间:2016-04-21 07:07:54

标签: ios kml google-earth

我正在开发一个将Google地球项目导入iOS应用程序的项目。当我将Google地球项目导出为KML(或KMZ)时,不会导出多边形的属性。举个例子:

 <Placemark>
            <name>Boko Haram Territory - Current</name>
            <styleUrl>#transGreenPoly</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            12.70213131043391,11.21355437778219,0 12.76213125508861,11.11351379017489,0 12.80421246808032,10.88806232016611,0 12.81140564976727,10.88474047056056,0 12.82588348845796,10.87462437857204,0 12.97939393108183,10.83966554281775,0 13.01510820482933,10.83000208944705,0 13.07942019606773,10.81053246258202,0 13.14001872784027,10.79444004548873,0 13.17185030048722,10.79508081378772,0 13.18953386465979,10.79543528924301,0 13.20368048739284,10.79571825387904,0 13.2743290941496,10.80058614475469,0 13.30607760464441,10.80467645272363,0 13.33421396206393,10.8121582665838,0 13.35520437351619,10.82296520370417,0 13.37982059654026,10.83038365174029,0 13.40082694596582,10.8411976344037,0 13.41829814104605,10.85194186295296,0 13.43237918897503,10.85568440985296,0 13.50979264821408,10.87798951527388,0 13.51679936970521,10.88159220711055,0 13.53768612847479,10.89933537465694,0 13.55497533303261,10.92048068470509,0 13.56880021101213,10.93809651898877,0 13.57915675601498,10.95217987296234,0 13.66923758481358,11.06510360559719,0 13.6691768923637,11.06858393737642,0 13.65988323190011,11.19395197671864,0 13.65250883139019,11.40721510169971,0 13.65213241070391,11.42824958002745,0 13.64837915330032,11.43870451829143,0 13.64112270150342,11.44558811843954,0 13.33559955678247,11.5522146556532,0 12.97984978381745,11.48909495336167,0 12.82247610438195,11.36661781158571,0 12.70213131043391,11.21355437778219,0
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>

这是多边形的信息 - 但是假设在这里的属性#transGreenPoly不包含在文件中,因此我的KML解析器没有足够的信息来在iOS中绘制多边形。如果我像这样添加手册:

<Style id="transGreenPoly">
  <LineStyle>
    <width>1.5</width>
  </LineStyle>
  <PolyStyle>
    <color>7d00ff00</color>
  </PolyStyle>
</Style>

它会起作用,但是因为我们正在处理几十个不是解决方案的聚合物。有没有办法从Google地球获取样式网址

0 个答案:

没有答案