google-maps-ios-utils icon indicating copy to clipboard operation
google-maps-ios-utils copied to clipboard

StyleUrl for GMUPlacemark not matching up with any GMUStyle within the _styles property of GMUGeometryRenderer.

Open kwilk83 opened this issue 7 years ago • 5 comments

I have found that when the below kml document is parsed by GMUKMLParser, the resulting GMUPlacemark object does not have a valid string within the StyleUrl property that references a GMUStyle object. Thus no style is applied to the given placemark despite being set and exported via Google Earth Pro desktop Mac app.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
	<name>KW Path.kml</name>
	<Style id="sn_ylw-pushpin">
		<IconStyle>
			<scale>1.1</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
		<LineStyle>
			<color>ff00c2ff</color>
			<width>2</width>
		</LineStyle>
	</Style>
	<Style id="sh_ylw-pushpin">
		<IconStyle>
			<scale>1.3</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
		<LineStyle>
			<color>ff00c2ff</color>
			<width>2</width>
		</LineStyle>
	</Style>
	<StyleMap id="msn_ylw-pushpin">
		<Pair>
			<key>normal</key>
			<styleUrl>#sn_ylw-pushpin</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#sh_ylw-pushpin</styleUrl>
		</Pair>
	</StyleMap>
	<Placemark>
		<name>KW Path</name>
		<styleUrl>#msn_ylw-pushpin</styleUrl>
		<LineString>
			<tessellate>1</tessellate>
			<coordinates>
				-95.40955451587095,29.68319223122121,0 -95.41162049810978,29.68311038759943,0 
			</coordinates>
		</LineString>
	</Placemark>
</Document>
</kml>

kwilk83 avatar Jan 11 '19 20:01 kwilk83

I am having same problem. It looks like GMUKMLParser is not properly parsing the Pair tag in StyleMap

amphib avatar Feb 14 '19 18:02 amphib

https://github.com/googlemaps/google-maps-ios-utils/pull/228

ArtemBoboshko avatar Apr 23 '19 14:04 ArtemBoboshko

Unfortunately I don't think your change fixes the problem. I've put the change into my code, and I still have issues with styling placemarks.

BenjaminCreem avatar Jul 03 '19 02:07 BenjaminCreem

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

stale[bot] avatar Oct 03 '19 23:10 stale[bot]

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

stale[bot] avatar Nov 02 '19 23:11 stale[bot]