Kml.swift
Kml.swift copied to clipboard
Add support for reading simple ExtendedData tag
Added support for untyped ExtendedData, as per: https://developers.google.com/kml/documentation/extendeddata
In your doc.kml:
<Placemark>
...
<ExtendedData>
<Data name="foo">
<displayName>Display</displayName>
<value>bar</value>
</Data>
</ExtendedData>
...
</Placemark>
Swift code to access the extended data:
let value = placemark.extendedData?.data["foo"]?.value
let displayName = placemark.extendedData?.data["foo"]?.displayName
Added a link from KMLAnnotation to KMLPlacemark so that the extended data can be accessed when building up the annotation view in MKMapViewDelegate.mapView(_:viewFor:)