private void SetSourceInternal(Stream stream)
{
using (Stream seekableStream = ConvertToSeekable(stream))
{
XDocument xLocalDoc;
if (IsStreamCompressed(seekableStream))
{
// Feed result into ZIP library
// Extract KML file embedded within KMZ file and extract point image file names
ZipFile zipFile = ZipFile.Read(seekableStream);
xLocalDoc = GetKmzContents(zipFile);
}
else
{
xLocalDoc = LoadDocument(seekableStream);
}
if (xLocalDoc != null)
{
_isRoot = true;
// Assign folder IDS for web maps
AssignFolderIDs(xLocalDoc.Root);
// keep root element for future parse (in background)
_context.Element = xLocalDoc.Root;
}
}
}