This is not an issue in the controls. We are loading the tile images with the Microsoft Image.FromFile method. Loading images from the file system may lock the files on some Windows systems. The same error can be reproduced in a similar scenario in an empty form without the RadMap control.
The scenario in the project requires to delete the images from the file system as soon as the form with the map closes. A custom map provider loading the images as Bitmaps can help:
publicclassCustomLocalMapProvider : LocalMapProvider
publicoverride Image LoadTile(int x, int y, int zoom)
string key = Path.Combine(this.DirectoryPath, string.Format(this.FileFormat, x, y, zoom));
using (var bmpTemp = new Bitmap(key))
tile = new Bitmap(bmpTemp);
tile = this.NoImageAvailable;
It is also necessary to call the map`s Dispose method when closing the form.
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.