Kml.swift
Kml.swift copied to clipboard
Importing KML from Google Earth Web Causes Crash
Looking at a KML that was generated from the web version of google earth I see the following tag that causes a crash in the style parsing:
<name>Google Earth Web KML FILE web</name>
<gx:CascadingStyle kml:id="__managed_style_0318E6AFC5265754105B">
<Style>
<IconStyle>
<scale>1.2</scale>
<Icon>
<href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&id=2000&scale=4</href>
</Icon>
<hotSpot x="64" y="128" xunits="pixels" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
</LabelStyle>
<LineStyle>
<color>ff2dc0fb</color>
<width>4.8</width>
</LineStyle>
<PolyStyle>
<color>40ffffff</color>
</PolyStyle>
<BalloonStyle>
<displayMode>hide</displayMode>
</BalloonStyle>
</Style>
</gx:CascadingStyle>
<gx:CascadingStyle kml:id="__managed_style_1B1AB55863265754105A">
<Style>
<IconStyle>
<Icon>
<href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&id=2000&scale=4</href>
</Icon>
<hotSpot x="64" y="128" xunits="pixels" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
</LabelStyle>
<LineStyle>
<color>ff2dc0fb</color>
<width>3.2</width>
</LineStyle>
<PolyStyle>
<color>40ffffff</color>
</PolyStyle>
<BalloonStyle>
<displayMode>hide</displayMode>
</BalloonStyle>
</Style>
</gx:CascadingStyle>
<StyleMap id="__managed_style_01024CD06B265754105A">
<Pair>
<key>normal</key>
<styleUrl>#__managed_style_1B1AB55863265754105A</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#__managed_style_0318E6AFC5265754105B</styleUrl>
</Pair>
</StyleMap>
gx:CascadingStyle tag is not supported in this library. Please refer to the sample.kml
https://github.com/asus4/Kml.swift/blob/master/Kml/sample.kml