This project has moved. For the latest updates, please go here.

file: URI not working on UWP implementation

Aug 30, 2016 at 2:29 AM
Hi Clemens,

I'm porting my code from WPF to Universal platform, and cannot get my "file:" URIs to work.
My tiles are in TMS format:
     private TileLayer layer1 = new TileLayer
    {
        SourceName = "SHN",
        TileSource = new TileSource { UriFormat = "file:///C:/SHN/{z}/{x}/{v}.png" }
    };
Other type of URI's are working fine though.

I've traced the problem down to the point where a valid tile (AbsolutePath = "C:/SHN/7/44/50.png") is queued for download.

And get this error on the Output Window:

An invalid request URI was provided.
Exception thrown: 'System.Runtime.InteropServices.COMException' in MapControl.WinRT.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in MapControl.WinRT.dll
file:///C:/SHN/7/44/50.png: A method was called at an unexpected time.

Any clues?

Thanks,
Fernando.
Coordinator
Aug 30, 2016 at 7:01 AM
UWP apps aren't allowed to access all file system locations.

See here: https://msdn.microsoft.com/en-us/windows/uwp/files/file-access-permissions
Aug 30, 2016 at 1:28 PM
Once again ... you are absolutely right ...

Thanks Clemens!