How to create child folders or documents with sharpkml

437 Views Asked by At

Does anyone know how to create child folders or documents with sharpkml? I have currently one folder which has a few documents in it but I can't add folder. It would be nice if somebody would have an idea.

1

There are 1 best solutions below

0
Merenzo On

This works for me:

// Create the Kml and initialise its root document.
var kml = new Kml();
var document = new Document { Name = "My Document", Open = true };
kml.Feature = document;

// Add a folder.
var folder = new Folder { Id = "data-layers", Name = "Data Layers" };
document.AddFeature(folder);