mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 22:46:58 +00:00
Add FilePath helper class
This commit is contained in:
parent
7d1d7dbe23
commit
421f323116
5 changed files with 27 additions and 4 deletions
21
MapControl/Shared/FilePath.cs
Normal file
21
MapControl/Shared/FilePath.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2022 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public static class FilePath
|
||||
{
|
||||
public static string GetFullPath(string path)
|
||||
{
|
||||
#if WINUI
|
||||
return Path.GetFullPath(path, AppDomain.CurrentDomain.BaseDirectory);
|
||||
#else
|
||||
return Path.GetFullPath(path);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ namespace MapControl
|
|||
|
||||
private static async Task<IEnumerable<ImageOverlay>> ReadGroundOverlaysFromFileAsync(string docFilePath)
|
||||
{
|
||||
docFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, docFilePath);
|
||||
docFilePath = FilePath.GetFullPath(docFilePath);
|
||||
|
||||
var docUri = new Uri(docFilePath);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue