Kml.swift icon indicating copy to clipboard operation
Kml.swift copied to clipboard

Importing KML from Google Earth Web Causes Crash

Open SpaceTrucker2196 opened this issue 3 years ago • 1 comments

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&amp;id=2000&amp;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&amp;id=2000&amp;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>

SpaceTrucker2196 avatar Dec 20 '22 19:12 SpaceTrucker2196

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

asus4 avatar Dec 21 '22 20:12 asus4