Scott2
1
I have looked over the KML Sample and I have importing of KML working. However, in a file such as the following…
…
<Document>
<Placemark>
<name>Pivot Point</name>
<Point>
<coordinates>-85.3790165327885,39.8638008907688</coordinates>
</Point>
</Placemark>
…
How do I access the name property? I have several geometries to import and being able to reference the name would be helpful. Thanks.
Johnny
2
Hi Scott,
Please try the below codes in KmlFeatureSource.cs:
private void ProcessPlacemark(XmlNode placemark, XmlNamespaceManager manager)
{
XmlNode stylesNode = placemark.SelectSingleNode("kk:Style", manager);
Dictionary<string, string> columnValues = GetColumnValues(stylesNode, manager);
XmlNode descriptionNode = placemark.SelectSingleNode("kk:description", manager);
XmlNode name = placemark.SelectSingleNode("kk:name", manager);
if (descriptionNode != null)
{
columnValues.Add("popupHTML", descriptionNode.InnerXml);
}
if (name != null)
{
columnValues.Add("name", name.InnerXml);
}
…
}
Hope it can help.
Thanks,
Johnny
Johnny
4
Hi Scott,
Good to hear it works.
Johnny