Where does the kml file loading process occur?

516
1
05-07-2021 07:57 AM
RobWag
by
New Contributor II

Hello, I'm still quite new with the ArcGIS SDK.

I'm loading a kml file into my application to display its content in a xaml treeview. And it works fine.

But unfortunately if the kml file is very large then my application freezes during the loading process.

That's why I decided to outsource the loading process into another thread. But I don't know where the loading process exactly occurs.

I open a file dialog and parse the content of the kml file into a kmlTree.

OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "KML File|*.kml";
openFileDialog.Title = "Open KML file:";
Nullable<bool> dialogResult = openFileDialog.ShowDialog();
if (dialogResult == true)
{
   string path = openFileDialog.FileName;
   Uri kmlUri = new Uri(path);
   Dataset = new KmlDataset(kmlUri);
   KmlLayer layer = new KmlLayer(Dataset);
   SavesTreeToLayer.Add(kmlTree, layer);
   mapView.Map.OperationalLayers.Add(layer);
}

 

Does anybody have an idea?

Thanks in advance.

0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor

Hi,

decided to outsource the loading process into another thread. But I don't know where the loading process exactly occurs.

Do you mean your loading process or ArcGIS Runtime parsing the KML contents?

Can you share any code?

 

While it's UWP, this demo might help: https://github.com/Esri/arcgis-runtime-demos-dotnet/tree/main/src/KmlViewer/KmlViewer

0 Kudos