I am reading in a KmlGroundOverlay that references a tiff file.
I write the KmlGroundOverlay to a a Stream.
I save the Stream to a file.
Everything works as expected except the referenced tiff file is not included in the KMZ.
Is this because I'm importing into the incorrect place when i first read the file?
My KmlGroundOverlays are displayed as excepted over my basemaps in my app.
private async Task LoadAndSaveKmz(StorageFile file, StorageFolder exportFolder)
{
var localFile = await
ApplicationData.Current.TemporaryFolder.CreateFileAsync(
file.Name, Windows.Storage.CreationCollisionOption.ReplaceExisting);
await file.CopyAndReplaceAsync(localFile);
source = new Uri(localFile.Path);
KmlLayer layer = new KmlLayer(source);
await layer.LoadAsync();
//get access to kml node (omitting that code here)
KmlNode node = GetNodeFromLayer(layer);
string filename = "node.kmz";
StorageFile file = await exportFolder.CreateFileAsync(filename,
CreationCollisionOption.ReplaceExisting);
using (Stream stream = await file.OpenStreamForWriteAsync())
{
await node.WriteToAsync(stream);
}
}