mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Version 4.12. Added MapControl.Images project, fixed assembly signing
This commit is contained in:
parent
3310f58912
commit
ac26c57a81
|
|
@ -13,7 +13,7 @@ using SQLiteConnection = Microsoft.Data.Sqlite.SqliteConnection;
|
||||||
using System.Data.SQLite;
|
using System.Data.SQLite;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace MapControl
|
namespace MapControl.MBTiles
|
||||||
{
|
{
|
||||||
public class MBTileData : IDisposable
|
public class MBTileData : IDisposable
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using Windows.UI.Xaml;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace MapControl
|
namespace MapControl.MBTiles
|
||||||
{
|
{
|
||||||
public class MBTileLayer : MapTileLayer
|
public class MBTileLayer : MapTileLayer
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ using Windows.UI.Xaml.Media;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace MapControl
|
namespace MapControl.MBTiles
|
||||||
{
|
{
|
||||||
public class MBTileSource : TileSource, IDisposable
|
public class MBTileSource : TileSource, IDisposable
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<ProjectGuid>{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}</ProjectGuid>
|
<ProjectGuid>{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>MapControl</RootNamespace>
|
<RootNamespace>MapControl.MBTiles</RootNamespace>
|
||||||
<AssemblyName>MBTiles.UWP</AssemblyName>
|
<AssemblyName>MBTiles.UWP</AssemblyName>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Data.SQLite">
|
<PackageReference Include="Microsoft.Data.SQLite">
|
||||||
<Version>2.1.0</Version>
|
<Version>2.2.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||||
<Version>6.2.2</Version>
|
<Version>6.2.2</Version>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<ProjectGuid>{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}</ProjectGuid>
|
<ProjectGuid>{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>MapControl</RootNamespace>
|
<RootNamespace>MapControl.MBTiles</RootNamespace>
|
||||||
<AssemblyName>MBTiles.WPF</AssemblyName>
|
<AssemblyName>MBTiles.WPF</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
|
@ -32,6 +32,12 @@
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
|
|
@ -63,6 +69,9 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="..\..\MapControl.snk">
|
||||||
|
<Link>MapControl.snk</Link>
|
||||||
|
</None>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,9 @@ using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
#if WINDOWS_UWP
|
#if WINDOWS_UWP
|
||||||
using Windows.Web.Http;
|
using Windows.Web.Http;
|
||||||
using Windows.UI.Xaml.Media;
|
|
||||||
using Windows.UI.Xaml.Media.Imaging;
|
using Windows.UI.Xaml.Media.Imaging;
|
||||||
#else
|
#else
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -24,23 +22,23 @@ namespace MapControl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HttpClient HttpClient { get; set; } = new HttpClient();
|
public static HttpClient HttpClient { get; set; } = new HttpClient();
|
||||||
|
|
||||||
public static async Task<ImageSource> LoadImageAsync(Uri uri)
|
public static async Task<BitmapSource> LoadImageAsync(Uri uri)
|
||||||
{
|
{
|
||||||
ImageSource imageSource = null;
|
BitmapSource image = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!uri.IsAbsoluteUri || uri.Scheme == "file")
|
if (!uri.IsAbsoluteUri || uri.Scheme == "file")
|
||||||
{
|
{
|
||||||
imageSource = await LoadLocalImageAsync(uri);
|
image = await LoadLocalImageAsync(uri);
|
||||||
}
|
}
|
||||||
else if (uri.Scheme == "http" || uri.Scheme == "https")
|
else if (uri.Scheme == "http" || uri.Scheme == "https")
|
||||||
{
|
{
|
||||||
imageSource = await LoadHttpImageAsync(uri);
|
image = await LoadHttpImageAsync(uri);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
imageSource = new BitmapImage(uri);
|
image = new BitmapImage(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -48,12 +46,12 @@ namespace MapControl
|
||||||
Debug.WriteLine("ImageLoader: {0}: {1}", uri, ex.Message);
|
Debug.WriteLine("ImageLoader: {0}: {1}", uri, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return imageSource;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
private static async Task<BitmapSource> LoadHttpImageAsync(Uri uri)
|
||||||
{
|
{
|
||||||
ImageSource imageSource = null;
|
BitmapSource image = null;
|
||||||
|
|
||||||
using (var response = await HttpClient.GetAsync(uri))
|
using (var response = await HttpClient.GetAsync(uri))
|
||||||
{
|
{
|
||||||
|
|
@ -63,11 +61,11 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
else if (IsTileAvailable(response.Headers))
|
else if (IsTileAvailable(response.Headers))
|
||||||
{
|
{
|
||||||
imageSource = await LoadImageAsync(response.Content);
|
image = await LoadImageAsync(response.Content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return imageSource;
|
return image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,6 @@ using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Windows.Storage.Streams;
|
using Windows.Storage.Streams;
|
||||||
using Windows.UI.Xaml.Media;
|
|
||||||
using Windows.UI.Xaml.Media.Imaging;
|
using Windows.UI.Xaml.Media.Imaging;
|
||||||
using Windows.Web.Http;
|
using Windows.Web.Http;
|
||||||
using Windows.Web.Http.Headers;
|
using Windows.Web.Http.Headers;
|
||||||
|
|
@ -18,14 +17,14 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
public static partial class ImageLoader
|
public static partial class ImageLoader
|
||||||
{
|
{
|
||||||
public static async Task<ImageSource> LoadImageAsync(IRandomAccessStream stream)
|
public static async Task<BitmapSource> LoadImageAsync(IRandomAccessStream stream)
|
||||||
{
|
{
|
||||||
var bitmapImage = new BitmapImage();
|
var image = new BitmapImage();
|
||||||
await bitmapImage.SetSourceAsync(stream);
|
await image.SetSourceAsync(stream);
|
||||||
return bitmapImage;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<ImageSource> LoadImageAsync(byte[] buffer)
|
public static async Task<BitmapSource> LoadImageAsync(byte[] buffer)
|
||||||
{
|
{
|
||||||
using (var stream = new InMemoryRandomAccessStream())
|
using (var stream = new InMemoryRandomAccessStream())
|
||||||
{
|
{
|
||||||
|
|
@ -35,7 +34,7 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<ImageSource> LoadImageAsync(IHttpContent content)
|
private static async Task<BitmapSource> LoadImageAsync(IHttpContent content)
|
||||||
{
|
{
|
||||||
using (var stream = new InMemoryRandomAccessStream())
|
using (var stream = new InMemoryRandomAccessStream())
|
||||||
{
|
{
|
||||||
|
|
@ -45,9 +44,9 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<ImageSource> LoadLocalImageAsync(Uri uri)
|
private static async Task<BitmapSource> LoadLocalImageAsync(Uri uri)
|
||||||
{
|
{
|
||||||
ImageSource imageSource = null;
|
BitmapSource image = null;
|
||||||
var path = uri.IsAbsoluteUri ? uri.LocalPath : uri.OriginalString;
|
var path = uri.IsAbsoluteUri ? uri.LocalPath : uri.OriginalString;
|
||||||
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
|
|
@ -56,11 +55,11 @@ namespace MapControl
|
||||||
|
|
||||||
using (var stream = await file.OpenReadAsync())
|
using (var stream = await file.OpenReadAsync())
|
||||||
{
|
{
|
||||||
imageSource = await LoadImageAsync(stream);
|
image = await LoadImageAsync(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return imageSource;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static async Task<Tuple<IBuffer, TimeSpan?>> LoadHttpBufferAsync(Uri uri)
|
internal static async Task<Tuple<IBuffer, TimeSpan?>> LoadHttpBufferAsync(Uri uri)
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,13 @@ using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
namespace MapControl
|
namespace MapControl
|
||||||
{
|
{
|
||||||
public static partial class ImageLoader
|
public static partial class ImageLoader
|
||||||
{
|
{
|
||||||
public static ImageSource LoadImage(Stream stream)
|
public static BitmapSource LoadImage(Stream stream)
|
||||||
{
|
{
|
||||||
var bitmapImage = new BitmapImage();
|
var bitmapImage = new BitmapImage();
|
||||||
bitmapImage.BeginInit();
|
bitmapImage.BeginInit();
|
||||||
|
|
@ -28,12 +27,12 @@ namespace MapControl
|
||||||
return bitmapImage;
|
return bitmapImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task<ImageSource> LoadImageAsync(Stream stream)
|
public static Task<BitmapSource> LoadImageAsync(Stream stream)
|
||||||
{
|
{
|
||||||
return Task.Run(() => LoadImage(stream));
|
return Task.Run(() => LoadImage(stream));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageSource LoadImage(byte[] buffer)
|
public static BitmapSource LoadImage(byte[] buffer)
|
||||||
{
|
{
|
||||||
using (var stream = new MemoryStream(buffer))
|
using (var stream = new MemoryStream(buffer))
|
||||||
{
|
{
|
||||||
|
|
@ -41,12 +40,12 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task<ImageSource> LoadImageAsync(byte[] buffer)
|
public static Task<BitmapSource> LoadImageAsync(byte[] buffer)
|
||||||
{
|
{
|
||||||
return Task.Run(() => LoadImage(buffer));
|
return Task.Run(() => LoadImage(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<ImageSource> LoadImageAsync(HttpContent content)
|
private static async Task<BitmapSource> LoadImageAsync(HttpContent content)
|
||||||
{
|
{
|
||||||
using (var stream = new MemoryStream())
|
using (var stream = new MemoryStream())
|
||||||
{
|
{
|
||||||
|
|
@ -56,23 +55,23 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImageSource LoadLocalImage(Uri uri)
|
private static BitmapSource LoadLocalImage(Uri uri)
|
||||||
{
|
{
|
||||||
ImageSource imageSource = null;
|
BitmapSource image = null;
|
||||||
var path = uri.IsAbsoluteUri ? uri.LocalPath : uri.OriginalString;
|
var path = uri.IsAbsoluteUri ? uri.LocalPath : uri.OriginalString;
|
||||||
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
using (var stream = File.OpenRead(path))
|
using (var stream = File.OpenRead(path))
|
||||||
{
|
{
|
||||||
imageSource = LoadImage(stream);
|
image = LoadImage(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return imageSource;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Task<ImageSource> LoadLocalImageAsync(Uri uri)
|
private static Task<BitmapSource> LoadLocalImageAsync(Uri uri)
|
||||||
{
|
{
|
||||||
return Task.Run(() => LoadLocalImage(uri));
|
return Task.Run(() => LoadLocalImage(uri));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApplication", "SampleApp
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapProjections.UWP", "MapProjections\UWP\MapProjections.UWP.csproj", "{9EE69591-5EDC-45E3-893E-2F9A4B82D538}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapProjections.UWP", "MapProjections\UWP\MapProjections.UWP.csproj", "{9EE69591-5EDC-45E3-893E-2F9A4B82D538}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapImages", "MapImages", "{2FDC8B91-FB95-4C57-8183-63587FBFE180}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapImages.WPF", "MapImages\WPF\MapImages.WPF.csproj", "{52042F63-563A-45BB-9A08-A8635AAAB84C}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapImages.UWP", "MapImages\UWP\MapImages.UWP.csproj", "{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -213,6 +219,38 @@ Global
|
||||||
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x64.Build.0 = Release|Any CPU
|
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x86.ActiveCfg = Release|Any CPU
|
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x86.Build.0 = Release|Any CPU
|
{9EE69591-5EDC-45E3-893E-2F9A4B82D538}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|ARM.Build.0 = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|ARM.Build.0 = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
@ -228,6 +266,8 @@ Global
|
||||||
{426C21C0-5F14-491F-BCD1-6D2993510420} = {7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D}
|
{426C21C0-5F14-491F-BCD1-6D2993510420} = {7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D}
|
||||||
{F92DA93D-75DB-4308-A5F9-6B4C3908A675} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
|
{F92DA93D-75DB-4308-A5F9-6B4C3908A675} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
|
||||||
{9EE69591-5EDC-45E3-893E-2F9A4B82D538} = {7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D}
|
{9EE69591-5EDC-45E3-893E-2F9A4B82D538} = {7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D}
|
||||||
|
{52042F63-563A-45BB-9A08-A8635AAAB84C} = {2FDC8B91-FB95-4C57-8183-63587FBFE180}
|
||||||
|
{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372} = {2FDC8B91-FB95-4C57-8183-63587FBFE180}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB}
|
SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB}
|
||||||
|
|
|
||||||
205
MapImages/Shared/GroundOverlayPanel.cs
Normal file
205
MapImages/Shared/GroundOverlayPanel.cs
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
#if WINDOWS_UWP
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Media;
|
||||||
|
#else
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public partial class GroundOverlayPanel : MapPanel
|
||||||
|
{
|
||||||
|
class LatLonBox : BoundingBox
|
||||||
|
{
|
||||||
|
public LatLonBox(double south, double west, double north, double east, double rotation)
|
||||||
|
: base(south, west, north, east)
|
||||||
|
{
|
||||||
|
Rotation = rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double Rotation { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImageOverlay
|
||||||
|
{
|
||||||
|
public ImageOverlay(LatLonBox latLonBox, string imagePath, int zIndex)
|
||||||
|
{
|
||||||
|
LatLonBox = latLonBox;
|
||||||
|
ImagePath = imagePath;
|
||||||
|
ZIndex = zIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LatLonBox LatLonBox { get; }
|
||||||
|
public string ImagePath { get; }
|
||||||
|
public int ZIndex { get; }
|
||||||
|
public ImageSource ImageSource { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty KmlFileProperty = DependencyProperty.Register(
|
||||||
|
nameof(KmlFile), typeof(string), typeof(GroundOverlayPanel),
|
||||||
|
new PropertyMetadata(null, async (o, e) => await ((GroundOverlayPanel)o).KmlFilePropertyChanged((string)e.NewValue)));
|
||||||
|
|
||||||
|
public string KmlFile
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(KmlFileProperty); }
|
||||||
|
set { SetValue(KmlFileProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task KmlFilePropertyChanged(string path)
|
||||||
|
{
|
||||||
|
IEnumerable<ImageOverlay> imageOverlays = null;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var ext = Path.GetExtension(path).ToLower();
|
||||||
|
if (ext == ".kmz")
|
||||||
|
{
|
||||||
|
imageOverlays = await ReadGroundOverlaysFromArchive(path);
|
||||||
|
}
|
||||||
|
else if (ext == ".kml")
|
||||||
|
{
|
||||||
|
imageOverlays = await ReadGroundOverlaysFromFile(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("GroundOverlayPanel: {0}: {1}", path, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Children.Clear();
|
||||||
|
|
||||||
|
if (imageOverlays != null)
|
||||||
|
{
|
||||||
|
AddImageOverlays(imageOverlays);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddImageOverlays(IEnumerable<ImageOverlay> imageOverlays)
|
||||||
|
{
|
||||||
|
foreach (var imageOverlay in imageOverlays.Where(i => i.ImageSource != null))
|
||||||
|
{
|
||||||
|
FrameworkElement overlay = new Image
|
||||||
|
{
|
||||||
|
Source = imageOverlay.ImageSource,
|
||||||
|
Stretch = Stretch.Fill
|
||||||
|
};
|
||||||
|
|
||||||
|
if (imageOverlay.LatLonBox.Rotation != 0d)
|
||||||
|
{
|
||||||
|
overlay.RenderTransform = new RotateTransform { Angle = -imageOverlay.LatLonBox.Rotation };
|
||||||
|
overlay.RenderTransformOrigin = new Point(0.5, 0.5);
|
||||||
|
|
||||||
|
// additional Panel for map rotation, see MapPanel.ArrangeElementWithBoundingBox
|
||||||
|
var panel = new Grid { Background = null };
|
||||||
|
panel.Children.Add(overlay);
|
||||||
|
overlay = panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetBoundingBox(overlay, imageOverlay.LatLonBox);
|
||||||
|
Canvas.SetZIndex(overlay, imageOverlay.ZIndex);
|
||||||
|
Children.Add(overlay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<ImageOverlay> ReadGroundOverlays(XmlDocument kmlDocument)
|
||||||
|
{
|
||||||
|
foreach (XmlElement groundOverlayElement in kmlDocument.GetElementsByTagName("GroundOverlay"))
|
||||||
|
{
|
||||||
|
LatLonBox latLonBox = null;
|
||||||
|
string imagePath = null;
|
||||||
|
int zIndex = 0;
|
||||||
|
|
||||||
|
foreach (var childElement in groundOverlayElement.ChildNodes.OfType<XmlElement>())
|
||||||
|
{
|
||||||
|
switch (childElement.LocalName)
|
||||||
|
{
|
||||||
|
case "LatLonBox":
|
||||||
|
latLonBox = ReadLatLonBox(childElement);
|
||||||
|
break;
|
||||||
|
case "Icon":
|
||||||
|
imagePath = ReadImagePath(childElement);
|
||||||
|
break;
|
||||||
|
case "drawOrder":
|
||||||
|
int.TryParse(childElement.InnerText.Trim(), out zIndex);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (latLonBox != null && imagePath != null)
|
||||||
|
{
|
||||||
|
yield return new ImageOverlay(latLonBox, imagePath, zIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string ReadImagePath(XmlElement element)
|
||||||
|
{
|
||||||
|
string href = null;
|
||||||
|
|
||||||
|
foreach (var childElement in element.ChildNodes.OfType<XmlElement>())
|
||||||
|
{
|
||||||
|
switch (childElement.LocalName)
|
||||||
|
{
|
||||||
|
case "href":
|
||||||
|
href = childElement.InnerText.Trim();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return href;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LatLonBox ReadLatLonBox(XmlElement element)
|
||||||
|
{
|
||||||
|
double north = double.NaN;
|
||||||
|
double south = double.NaN;
|
||||||
|
double east = double.NaN;
|
||||||
|
double west = double.NaN;
|
||||||
|
double rotation = 0d;
|
||||||
|
|
||||||
|
foreach (var childElement in element.ChildNodes.OfType<XmlElement>())
|
||||||
|
{
|
||||||
|
switch (childElement.LocalName)
|
||||||
|
{
|
||||||
|
case "north":
|
||||||
|
double.TryParse(childElement.InnerText.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out north);
|
||||||
|
break;
|
||||||
|
case "south":
|
||||||
|
double.TryParse(childElement.InnerText.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out south);
|
||||||
|
break;
|
||||||
|
case "east":
|
||||||
|
double.TryParse(childElement.InnerText.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out east);
|
||||||
|
break;
|
||||||
|
case "west":
|
||||||
|
double.TryParse(childElement.InnerText.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out west);
|
||||||
|
break;
|
||||||
|
case "rotation":
|
||||||
|
double.TryParse(childElement.InnerText.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out rotation);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return !double.IsNaN(north) && !double.IsNaN(south) && !double.IsNaN(east) && !double.IsNaN(west)
|
||||||
|
? new LatLonBox(south, west, north, east, rotation)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
133
MapImages/Shared/WorldFile.cs
Normal file
133
MapImages/Shared/WorldFile.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MapControl.Projections;
|
||||||
|
#if WINDOWS_UWP
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Media;
|
||||||
|
using Windows.UI.Xaml.Media.Imaging;
|
||||||
|
#else
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public static class WorldFile
|
||||||
|
{
|
||||||
|
public static readonly DependencyProperty ImagePathProperty = DependencyProperty.RegisterAttached(
|
||||||
|
"ImagePath", typeof(string), typeof(WorldFile),
|
||||||
|
new PropertyMetadata(null, async (o, e) => await SetWorldImageAsync((Image)o, (string)e.NewValue)));
|
||||||
|
|
||||||
|
public static string GetImagePath(this Image image)
|
||||||
|
{
|
||||||
|
return (string)image.GetValue(ImagePathProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetImagePath(this Image image, string imagePath)
|
||||||
|
{
|
||||||
|
image.SetValue(ImagePathProperty, imagePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetWorldImage(this Image image, BitmapSource bitmapSource, WorldFileParameters parameters, MapProjection projection = null)
|
||||||
|
{
|
||||||
|
image.Source = bitmapSource;
|
||||||
|
image.Stretch = Stretch.Fill;
|
||||||
|
|
||||||
|
MapPanel.SetBoundingBox(image, parameters.GetBoundingBox(bitmapSource.PixelWidth, bitmapSource.PixelHeight, projection));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task SetWorldImageAsync(Image image, string imagePath)
|
||||||
|
{
|
||||||
|
var ext = Path.GetExtension(imagePath);
|
||||||
|
if (ext.Length < 4)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid image file path extension, must have at least three characters.");
|
||||||
|
}
|
||||||
|
|
||||||
|
BitmapSource bitmap;
|
||||||
|
using (var stream = File.OpenRead(imagePath))
|
||||||
|
{
|
||||||
|
#if WINDOWS_UWP
|
||||||
|
bitmap = await ImageLoader.LoadImageAsync(stream.AsRandomAccessStream());
|
||||||
|
#else
|
||||||
|
bitmap = await ImageLoader.LoadImageAsync(stream);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
var dir = Path.GetDirectoryName(imagePath);
|
||||||
|
var file = Path.GetFileNameWithoutExtension(imagePath);
|
||||||
|
var worldFilePath = Path.Combine(dir, file + ext.Remove(2, 1) + "w");
|
||||||
|
var projFilePath = Path.Combine(dir, file + ".prj");
|
||||||
|
|
||||||
|
var parameters = new WorldFileParameters(worldFilePath);
|
||||||
|
MapProjection projection = null;
|
||||||
|
|
||||||
|
if (File.Exists(projFilePath))
|
||||||
|
{
|
||||||
|
projection = new GeoApiProjection { WKT = File.ReadAllText(projFilePath) };
|
||||||
|
}
|
||||||
|
|
||||||
|
SetWorldImage(image, bitmap, parameters, projection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FrameworkElement CreateWorldImage(BitmapSource bitmap, WorldFileParameters parameters)
|
||||||
|
{
|
||||||
|
if (parameters.XScale == 0d || parameters.YScale == 0d)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid WorldFileParameters, XScale and YScale must be non-zero.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var pixelWidth = parameters.XScale;
|
||||||
|
var pixelHeight = parameters.YScale;
|
||||||
|
var rotation = 0d;
|
||||||
|
|
||||||
|
if (parameters.YSkew != 0 || parameters.XSkew != 0)
|
||||||
|
{
|
||||||
|
pixelWidth = Math.Sqrt(parameters.XScale * parameters.XScale + parameters.YSkew * parameters.YSkew);
|
||||||
|
pixelHeight = Math.Sqrt(parameters.YScale * parameters.YScale + parameters.XSkew * parameters.XSkew);
|
||||||
|
|
||||||
|
var xAxisRotation = Math.Atan2(parameters.YSkew, parameters.XScale) / Math.PI * 180d;
|
||||||
|
var yAxisRotation = Math.Atan2(parameters.XSkew, -parameters.YScale) / Math.PI * 180d;
|
||||||
|
rotation = 0.5 * (xAxisRotation + yAxisRotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
var x1 = parameters.XOrigin;
|
||||||
|
var x2 = parameters.XOrigin + pixelWidth * bitmap.PixelWidth;
|
||||||
|
var y1 = parameters.YOrigin;
|
||||||
|
var y2 = parameters.YOrigin + pixelHeight * bitmap.PixelHeight;
|
||||||
|
|
||||||
|
var bbox = new BoundingBox
|
||||||
|
{
|
||||||
|
West = Math.Min(x1, x2),
|
||||||
|
East = Math.Max(x1, x2),
|
||||||
|
South = Math.Min(y1, y2),
|
||||||
|
North = Math.Max(y1, y2)
|
||||||
|
};
|
||||||
|
|
||||||
|
FrameworkElement image = new Image
|
||||||
|
{
|
||||||
|
Source = bitmap,
|
||||||
|
Stretch = Stretch.Fill
|
||||||
|
};
|
||||||
|
|
||||||
|
if (rotation != 0d)
|
||||||
|
{
|
||||||
|
image.RenderTransform = new RotateTransform { Angle = rotation };
|
||||||
|
var panel = new Grid();
|
||||||
|
panel.Children.Add(image);
|
||||||
|
image = panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapPanel.SetBoundingBox(image, bbox);
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
94
MapImages/Shared/WorldFileParameters.cs
Normal file
94
MapImages/Shared/WorldFileParameters.cs
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
#if WINDOWS_UWP
|
||||||
|
using Windows.Foundation;
|
||||||
|
#else
|
||||||
|
using System.Windows;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public class WorldFileParameters
|
||||||
|
{
|
||||||
|
public WorldFileParameters()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public WorldFileParameters(string path)
|
||||||
|
{
|
||||||
|
if (!File.Exists(path))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("World file \"" + path + "\"not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var lines = File.ReadLines(path).Take(6).ToList();
|
||||||
|
|
||||||
|
if (lines.Count != 6)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid number of parameters in world file \"" + path + "\".");
|
||||||
|
}
|
||||||
|
|
||||||
|
double xscale, yskew, xskew, yscale, xorigin, yorigin;
|
||||||
|
|
||||||
|
if (!double.TryParse(lines[0], NumberStyles.Float, CultureInfo.InvariantCulture, out xscale) ||
|
||||||
|
!double.TryParse(lines[1], NumberStyles.Float, CultureInfo.InvariantCulture, out yskew) ||
|
||||||
|
!double.TryParse(lines[2], NumberStyles.Float, CultureInfo.InvariantCulture, out xskew) ||
|
||||||
|
!double.TryParse(lines[3], NumberStyles.Float, CultureInfo.InvariantCulture, out yscale) ||
|
||||||
|
!double.TryParse(lines[4], NumberStyles.Float, CultureInfo.InvariantCulture, out xorigin) ||
|
||||||
|
!double.TryParse(lines[5], NumberStyles.Float, CultureInfo.InvariantCulture, out yorigin))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Failed parsing parameters in world file \"" + path + "\".");
|
||||||
|
}
|
||||||
|
|
||||||
|
XScale = xscale;
|
||||||
|
YSkew = yskew;
|
||||||
|
XSkew = xskew;
|
||||||
|
YScale = yscale;
|
||||||
|
XOrigin = xorigin;
|
||||||
|
YOrigin = yorigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double XScale { get; set; }
|
||||||
|
public double YSkew { get; set; }
|
||||||
|
public double XSkew { get; set; }
|
||||||
|
public double YScale { get; set; }
|
||||||
|
public double XOrigin { get; set; }
|
||||||
|
public double YOrigin { get; set; }
|
||||||
|
|
||||||
|
public BoundingBox GetBoundingBox(double imageWidth, double imageHeight, MapProjection projection = null)
|
||||||
|
{
|
||||||
|
if (XScale == 0d || YScale == 0d)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid WorldFileParameters, XScale and YScale must be non-zero.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (YSkew != 0d || XSkew != 0d)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid WorldFileParameters, YSkew and XSkew must be zero.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var p1 = new Point(XOrigin, YOrigin);
|
||||||
|
var p2 = new Point(XOrigin + XScale * imageWidth, YOrigin + YScale * imageHeight);
|
||||||
|
var rect = new Rect(p1, p2);
|
||||||
|
|
||||||
|
if (projection != null)
|
||||||
|
{
|
||||||
|
return projection.RectToBoundingBox(rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new BoundingBox
|
||||||
|
{
|
||||||
|
West = rect.X,
|
||||||
|
East = rect.X + rect.Width,
|
||||||
|
South = rect.Y,
|
||||||
|
North = rect.Y + rect.Height
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
62
MapImages/Shared/ZoomLevelToOpacityConverter.cs
Normal file
62
MapImages/Shared/ZoomLevelToOpacityConverter.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
#if WINDOWS_UWP
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Data;
|
||||||
|
#else
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public class ZoomLevelToOpacityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public double MinZoomLevel { get; set; } = 0d;
|
||||||
|
public double MaxZoomLevel { get; set; } = 22d;
|
||||||
|
public double FadeZoomRange { get; set; } = 1d;
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (!(value is double))
|
||||||
|
{
|
||||||
|
return DependencyProperty.UnsetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var zoomLevel = (double)value;
|
||||||
|
var opacity = 0d;
|
||||||
|
|
||||||
|
if (zoomLevel > MinZoomLevel && zoomLevel < MaxZoomLevel)
|
||||||
|
{
|
||||||
|
opacity = 1d;
|
||||||
|
|
||||||
|
if (FadeZoomRange > 0d)
|
||||||
|
{
|
||||||
|
opacity = Math.Min(opacity, (zoomLevel - MinZoomLevel) / FadeZoomRange);
|
||||||
|
opacity = Math.Min(opacity, (MaxZoomLevel - zoomLevel) / FadeZoomRange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
return Convert(value, targetType, parameter, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
92
MapImages/UWP/GroundOverlayPanel.UWP.cs
Normal file
92
MapImages/UWP/GroundOverlayPanel.UWP.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
using Windows.Storage;
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public partial class GroundOverlayPanel
|
||||||
|
{
|
||||||
|
private async Task<List<ImageOverlay>> ReadGroundOverlaysFromFile(string docFile)
|
||||||
|
{
|
||||||
|
if (!Path.IsPathRooted(docFile))
|
||||||
|
{
|
||||||
|
docFile = Path.Combine(Directory.GetCurrentDirectory(), docFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
var docUri = new Uri(docFile);
|
||||||
|
|
||||||
|
var imageOverlays = await Task.Run(async () =>
|
||||||
|
{
|
||||||
|
var file = await StorageFile.GetFileFromPathAsync(docFile);
|
||||||
|
var kmlDocument = new XmlDocument();
|
||||||
|
|
||||||
|
using (var stream = await file.OpenReadAsync())
|
||||||
|
{
|
||||||
|
kmlDocument.Load(stream.AsStreamForRead());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReadGroundOverlays(kmlDocument).ToList();
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var imageOverlay in imageOverlays)
|
||||||
|
{
|
||||||
|
imageOverlay.ImageSource = await ImageLoader.LoadImageAsync(new Uri(docUri, imageOverlay.ImagePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
return imageOverlays;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<List<ImageOverlay>> ReadGroundOverlaysFromArchive(string archiveFile)
|
||||||
|
{
|
||||||
|
using (var archive = ZipFile.OpenRead(archiveFile))
|
||||||
|
{
|
||||||
|
var docEntry = archive.GetEntry("doc.kml")
|
||||||
|
?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml"));
|
||||||
|
|
||||||
|
if (docEntry == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("No KML entry found in " + archiveFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
var imageOverlays = await Task.Run(() =>
|
||||||
|
{
|
||||||
|
var kmlDocument = new XmlDocument();
|
||||||
|
|
||||||
|
using (var docStream = docEntry.Open())
|
||||||
|
{
|
||||||
|
kmlDocument.Load(docStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReadGroundOverlays(kmlDocument).ToList();
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var imageOverlay in imageOverlays)
|
||||||
|
{
|
||||||
|
var imageEntry = archive.GetEntry(imageOverlay.ImagePath);
|
||||||
|
|
||||||
|
if (imageEntry != null)
|
||||||
|
{
|
||||||
|
using (var zipStream = imageEntry.Open())
|
||||||
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
await zipStream.CopyToAsync(memoryStream);
|
||||||
|
memoryStream.Position = 0;
|
||||||
|
imageOverlay.ImageSource = await ImageLoader.LoadImageAsync(memoryStream.AsRandomAccessStream());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return imageOverlays;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
96
MapImages/UWP/MapImages.UWP.csproj
Normal file
96
MapImages/UWP/MapImages.UWP.csproj
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{BE08B7BC-8C89-4837-BCE7-EDDDABEAB372}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>MapControl.Images</RootNamespace>
|
||||||
|
<AssemblyName>MapImages.UWP</AssemblyName>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
|
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.10586.0</TargetPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
|
||||||
|
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\Shared\GroundOverlayPanel.cs">
|
||||||
|
<Link>GroundOverlayPanel.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\WorldFile.cs">
|
||||||
|
<Link>WorldFile.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\WorldFileParameters.cs">
|
||||||
|
<Link>WorldFileParameters.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\ZoomLevelToOpacityConverter.cs">
|
||||||
|
<Link>ZoomLevelToOpacityConverter.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="GroundOverlayPanel.UWP.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Properties\MapImages.UWP.rd.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||||
|
<Version>6.2.2</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\MapControl\UWP\MapControl.UWP.csproj">
|
||||||
|
<Project>{9545f73c-9c35-4cf6-baae-19a0baebd344}</Project>
|
||||||
|
<Name>MapControl.UWP</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\MapProjections\UWP\MapProjections.UWP.csproj">
|
||||||
|
<Project>{9ee69591-5edc-45e3-893e-2f9a4b82d538}</Project>
|
||||||
|
<Name>MapProjections.UWP</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\MapControl.snk">
|
||||||
|
<Link>MapControl.snk</Link>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
|
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
14
MapImages/UWP/Properties/AssemblyInfo.cs
Normal file
14
MapImages/UWP/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("XAML Map Control Image Support (UWP)")]
|
||||||
|
[assembly: AssemblyDescription("Image Support Library for XAML Map Control")]
|
||||||
|
[assembly: AssemblyProduct("XAML Map Control")]
|
||||||
|
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||||
|
[assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyVersion("4.12.0")]
|
||||||
|
[assembly: AssemblyFileVersion("4.12.0")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
33
MapImages/UWP/Properties/MapImages.UWP.rd.xml
Normal file
33
MapImages/UWP/Properties/MapImages.UWP.rd.xml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file contains Runtime Directives, specifications about types your application accesses
|
||||||
|
through reflection and other dynamic code patterns. Runtime Directives are used to control the
|
||||||
|
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
|
||||||
|
library does not do any reflection, then you generally do not need to edit this file. However,
|
||||||
|
if your library reflects over types, especially types passed to it or derived from its types,
|
||||||
|
then you should write Runtime Directives.
|
||||||
|
|
||||||
|
The most common use of reflection in libraries is to discover information about types passed
|
||||||
|
to the library. Runtime Directives have three ways to express requirements on types passed to
|
||||||
|
your library.
|
||||||
|
|
||||||
|
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
|
||||||
|
Use these directives to reflect over types passed as a parameter.
|
||||||
|
|
||||||
|
2. SubTypes
|
||||||
|
Use a SubTypes directive to reflect over types derived from another type.
|
||||||
|
|
||||||
|
3. AttributeImplies
|
||||||
|
Use an AttributeImplies directive to indicate that your library needs to reflect over
|
||||||
|
types or methods decorated with an attribute.
|
||||||
|
|
||||||
|
For more information on writing Runtime Directives for libraries, please visit
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=391919
|
||||||
|
-->
|
||||||
|
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||||
|
<Library Name="MapImages.UWP">
|
||||||
|
|
||||||
|
<!-- add directives for your library here -->
|
||||||
|
|
||||||
|
</Library>
|
||||||
|
</Directives>
|
||||||
86
MapImages/WPF/GroundOverlayPanel.WPF.cs
Normal file
86
MapImages/WPF/GroundOverlayPanel.WPF.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||||
|
// © 2018 Clemens Fischer
|
||||||
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
|
namespace MapControl.Images
|
||||||
|
{
|
||||||
|
public partial class GroundOverlayPanel
|
||||||
|
{
|
||||||
|
private async Task<List<ImageOverlay>> ReadGroundOverlaysFromFile(string docFile)
|
||||||
|
{
|
||||||
|
if (!Path.IsPathRooted(docFile))
|
||||||
|
{
|
||||||
|
docFile = Path.Combine(Directory.GetCurrentDirectory(), docFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
var docUri = new Uri(docFile);
|
||||||
|
|
||||||
|
var imageOverlays = await Task.Run(() =>
|
||||||
|
{
|
||||||
|
var kmlDocument = new XmlDocument();
|
||||||
|
kmlDocument.Load(docUri.ToString());
|
||||||
|
|
||||||
|
return ReadGroundOverlays(kmlDocument).ToList();
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var imageOverlay in imageOverlays)
|
||||||
|
{
|
||||||
|
imageOverlay.ImageSource = await ImageLoader.LoadImageAsync(new Uri(docUri, imageOverlay.ImagePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
return imageOverlays;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task<List<ImageOverlay>> ReadGroundOverlaysFromArchive(string archiveFile)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
using (var archive = ZipFile.OpenRead(archiveFile))
|
||||||
|
{
|
||||||
|
var docEntry = archive.GetEntry("doc.kml")
|
||||||
|
?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml"));
|
||||||
|
|
||||||
|
if (docEntry == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("No KML entry found in " + archiveFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
var kmlDocument = new XmlDocument();
|
||||||
|
|
||||||
|
using (var docStream = docEntry.Open())
|
||||||
|
{
|
||||||
|
kmlDocument.Load(docStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
var imageOverlays = ReadGroundOverlays(kmlDocument).ToList();
|
||||||
|
|
||||||
|
foreach (var imageOverlay in imageOverlays)
|
||||||
|
{
|
||||||
|
var imageEntry = archive.GetEntry(imageOverlay.ImagePath);
|
||||||
|
|
||||||
|
if (imageEntry != null)
|
||||||
|
{
|
||||||
|
using (var zipStream = imageEntry.Open())
|
||||||
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
zipStream.CopyTo(memoryStream);
|
||||||
|
memoryStream.Position = 0;
|
||||||
|
imageOverlay.ImageSource = ImageLoader.LoadImage(memoryStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return imageOverlays;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
MapImages/WPF/MapImages.WPF.csproj
Normal file
81
MapImages/WPF/MapImages.WPF.csproj
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{52042F63-563A-45BB-9A08-A8635AAAB84C}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>MapControl.Images</RootNamespace>
|
||||||
|
<AssemblyName>MapImages.WPF</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>none</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.IO.Compression.FileSystem" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\Shared\GroundOverlayPanel.cs">
|
||||||
|
<Link>GroundOverlayPanel.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\WorldFile.cs">
|
||||||
|
<Link>WorldFile.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\WorldFileParameters.cs">
|
||||||
|
<Link>WorldFileParameters.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\ZoomLevelToOpacityConverter.cs">
|
||||||
|
<Link>ZoomLevelToOpacityConverter.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="GroundOverlayPanel.WPF.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\MapControl\WPF\MapControl.WPF.csproj">
|
||||||
|
<Project>{a204a102-c745-4d65-aec8-7b96faedef2d}</Project>
|
||||||
|
<Name>MapControl.WPF</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\MapProjections\WPF\MapProjections.WPF.csproj">
|
||||||
|
<Project>{426c21c0-5f14-491f-bcd1-6d2993510420}</Project>
|
||||||
|
<Name>MapProjections.WPF</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\MapControl.snk">
|
||||||
|
<Link>MapControl.snk</Link>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
14
MapImages/WPF/Properties/AssemblyInfo.cs
Normal file
14
MapImages/WPF/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("XAML Map Control Image Support (WPF)")]
|
||||||
|
[assembly: AssemblyDescription("Image Support Library for XAML Map Control")]
|
||||||
|
[assembly: AssemblyProduct("XAML Map Control")]
|
||||||
|
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||||
|
[assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyVersion("4.12.0")]
|
||||||
|
[assembly: AssemblyFileVersion("4.12.0")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
@ -63,9 +63,20 @@
|
||||||
<Name>MapControl.UWP</Name>
|
<Name>MapControl.UWP</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\MapControl.snk">
|
||||||
|
<Link>MapControl.snk</Link>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="GeoAPI, Version=1.7.5.0, Culture=neutral, PublicKeyToken=a1a0da7def465678, processorArchitecture=MSIL">
|
<Reference Include="GeoAPI, Version=1.7.5.0, Culture=neutral, PublicKeyToken=a1a0da7def465678, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\GeoAPI.Core.1.7.5\lib\net45\GeoAPI.dll</HintPath>
|
<HintPath>..\..\packages\GeoAPI.Core.1.7.5\lib\net45\GeoAPI.dll</HintPath>
|
||||||
|
|
@ -65,6 +71,9 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="..\..\MapControl.snk">
|
||||||
|
<Link>MapControl.snk</Link>
|
||||||
|
</None>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue