Hi, I was wondering if there is any way to cleanup a deleted layer?
Let me explain: In our program, users can create their own layer types from files and display them.
They can also delete those layers. I have noticed that after deleting a layer, the index file is not freed (says it is still in use when creating a layer that uses the same file).
So I was wondering - what is the correct way of disposing of a layer?
Currently we do the following:
public async Task RemoveLayerFromMap(IViewerLayer viewerLayer)
{
if (Overlays.Contains(StaticOverlay))
{
if (StaticOverlay.Layers.Contains(viewerLayer.LayerName))
{
StaticOverlay.Layers.Remove(viewerLayer.LayerName);
await RefreshAsync(StaticOverlay);
}
}
}
with StaticOverlay being a LayerOverlay