Hello, I'm new with the ArcGIS SDK and try to find a way how to get the Geometry from a KmlNode, respectively from a kml file.
The general idea is to show to whole KmlNode structure from the kml file in a XAML TreeView and when you click on an item it should extract the Geometry.
Uri kmlUri = new Uri(path);
KmlDataset dataset = new KmlDataset(kmlUri);
KmlLayer layer = new KmlLayer(dataset);
MyMapView.Map.OperationalLayers.Add(layer);
foreach (KmlNode kmlRootNode in dataset.RootNodes)
{
KmlPlacemark kmlPlacemark = kmlRootNode as KmlPlacemark;
Geometry geometry = kmlPlacemark.Geometry;
}
I cast the KmlNode as a KmlPlacemark correctly, but the Geometry is ALWAYS null, I don't know why. Everything else like the GrahicType, the BalloonContent or the Extent of the KmlPlacemark are correct.
Does somebody have a hint for me what I am doing wrong or how I can solve this issue?
Thanks in advance.