Version 4.14. Added support for .NET Core 3

This commit is contained in:
ClemensF 2019-09-27 22:13:10 +02:00
parent a4fad94921
commit 23778280e1
35 changed files with 797 additions and 36 deletions

View file

@ -49,10 +49,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FileDb.Standard"> <PackageReference Include="FileDb.Standard">
<Version>7.4.3</Version> <Version>7.4.4</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -54,7 +54,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
<PackageReference Include="System.Data.SQLite.Core"> <PackageReference Include="System.Data.SQLite.Core">
<Version>1.0.111</Version> <Version>1.0.111</Version>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -15,6 +15,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalApp", "SampleApps\
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WPF.Core", "MapControl\WPF.Core\MapControl.WPF.Core.csproj", "{257D91EB-4DD1-4179-B9F3-7584BF5435D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfCoreApp", "SampleApps\WpfCoreApp\WpfCoreApp.csproj", "{E9D15B9A-75F5-40A9-A582-9BFBB074C127}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -99,6 +103,38 @@ Global
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.Build.0 = Release|Any CPU {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.Build.0 = Release|Any CPU
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.ActiveCfg = Release|Any CPU {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.ActiveCfg = Release|Any CPU
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.Build.0 = Release|Any CPU {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.Build.0 = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|ARM.ActiveCfg = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|ARM.Build.0 = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|x64.ActiveCfg = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|x64.Build.0 = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Debug|x86.Build.0 = Debug|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|Any CPU.Build.0 = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|ARM.ActiveCfg = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|ARM.Build.0 = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|x64.ActiveCfg = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|x64.Build.0 = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|x86.ActiveCfg = Release|Any CPU
{257D91EB-4DD1-4179-B9F3-7584BF5435D3}.Release|x86.Build.0 = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|ARM.Build.0 = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|x64.ActiveCfg = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|x64.Build.0 = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|x86.ActiveCfg = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Debug|x86.Build.0 = Debug|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|Any CPU.Build.0 = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|ARM.ActiveCfg = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|ARM.Build.0 = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|x64.ActiveCfg = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|x64.Build.0 = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|x86.ActiveCfg = Release|Any CPU
{E9D15B9A-75F5-40A9-A582-9BFBB074C127}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -108,6 +144,8 @@ Global
{F92DA93D-75DB-4308-A5F9-6B4C3908A675} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} {F92DA93D-75DB-4308-A5F9-6B4C3908A675} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} = {52AECE49-F314-4F76-98F2-FA800F07824B} {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} = {52AECE49-F314-4F76-98F2-FA800F07824B}
{257D91EB-4DD1-4179-B9F3-7584BF5435D3} = {52AECE49-F314-4F76-98F2-FA800F07824B}
{E9D15B9A-75F5-40A9-A582-9BFBB074C127} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB} SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB}

View file

@ -175,7 +175,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -0,0 +1,3 @@
using System.Windows;
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

View file

@ -0,0 +1,91 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWPF>true</UseWPF>
<RootNamespace>MapControl</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Product>XAML Map Control</Product>
<Authors>Clemens Fischer</Authors>
<Version>4.14.0</Version>
<Description>XAML Map Control Library</Description>
<Copyright>Copyright © 2019 Clemens Fischer</Copyright>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>XAML.MapControl.Core</PackageId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>TRACE;NET_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;NET_CORE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\AutoEquirectangularProjection.cs" Link="AutoEquirectangularProjection.cs" />
<Compile Include="..\Shared\AzimuthalEquidistantProjection.cs" Link="AzimuthalEquidistantProjection.cs" />
<Compile Include="..\Shared\AzimuthalProjection.cs" Link="AzimuthalProjection.cs" />
<Compile Include="..\Shared\BingMapsTileLayer.cs" Link="BingMapsTileLayer.cs" />
<Compile Include="..\Shared\BingMapsTileSource.cs" Link="BingMapsTileSource.cs" />
<Compile Include="..\Shared\BoundingBox.cs" Link="BoundingBox.cs" />
<Compile Include="..\Shared\CenteredBoundingBox.cs" Link="CenteredBoundingBox.cs" />
<Compile Include="..\Shared\EquirectangularProjection.cs" Link="EquirectangularProjection.cs" />
<Compile Include="..\Shared\GnomonicProjection.cs" Link="GnomonicProjection.cs" />
<Compile Include="..\Shared\HyperlinkText.cs" Link="HyperlinkText.cs" />
<Compile Include="..\Shared\ImageLoader.cs" Link="ImageLoader.cs" />
<Compile Include="..\Shared\Intersections.cs" Link="Intersections.cs" />
<Compile Include="..\Shared\Location.cs" Link="Location.cs" />
<Compile Include="..\Shared\LocationCollection.cs" Link="LocationCollection.cs" />
<Compile Include="..\Shared\LocationEx.cs" Link="LocationEx.cs" />
<Compile Include="..\Shared\MapBase.cs" Link="MapBase.cs" />
<Compile Include="..\Shared\MapGraticule.cs" Link="MapGraticule.cs" />
<Compile Include="..\Shared\MapImageLayer.cs" Link="MapImageLayer.cs" />
<Compile Include="..\Shared\MapItemsControl.cs" Link="MapItemsControl.cs" />
<Compile Include="..\Shared\MapOverlay.cs" Link="MapOverlay.cs" />
<Compile Include="..\Shared\MapPanel.cs" Link="MapPanel.cs" />
<Compile Include="..\Shared\MapPolygon.cs" Link="MapPolygon.cs" />
<Compile Include="..\Shared\MapPolyline.cs" Link="MapPolyline.cs" />
<Compile Include="..\Shared\MapProjection.cs" Link="MapProjection.cs" />
<Compile Include="..\Shared\MapScale.cs" Link="MapScale.cs" />
<Compile Include="..\Shared\MapShape.cs" Link="MapShape.cs" />
<Compile Include="..\Shared\MapTileLayer.cs" Link="MapTileLayer.cs" />
<Compile Include="..\Shared\OrthographicProjection.cs" Link="OrthographicProjection.cs" />
<Compile Include="..\Shared\PolygonCollection.cs" Link="PolygonCollection.cs" />
<Compile Include="..\Shared\Pushpin.cs" Link="Pushpin.cs" />
<Compile Include="..\Shared\StereographicProjection.cs" Link="StereographicProjection.cs" />
<Compile Include="..\Shared\Tile.cs" Link="Tile.cs" />
<Compile Include="..\Shared\TileGrid.cs" Link="TileGrid.cs" />
<Compile Include="..\Shared\TileImageLoader.cs" Link="TileImageLoader.cs" />
<Compile Include="..\Shared\TileSource.cs" Link="TileSource.cs" />
<Compile Include="..\Shared\ViewportChangedEventArgs.cs" Link="ViewportChangedEventArgs.cs" />
<Compile Include="..\Shared\WebMercatorProjection.cs" Link="WebMercatorProjection.cs" />
<Compile Include="..\Shared\WmsImageLayer.cs" Link="WmsImageLayer.cs" />
<Compile Include="..\Shared\WorldMercatorProjection.cs" Link="WorldMercatorProjection.cs" />
<Compile Include="..\WPF\ImageFileCache.WPF.cs" Link="ImageFileCache.WPF.cs" />
<Compile Include="..\WPF\ImageLoader.WPF.cs" Link="ImageLoader.WPF.cs" />
<Compile Include="..\WPF\Map.WPF.cs" Link="Map.WPF.cs" />
<Compile Include="..\WPF\MapBase.WPF.cs" Link="MapBase.WPF.cs" />
<Compile Include="..\WPF\MapGraticule.WPF.cs" Link="MapGraticule.WPF.cs" />
<Compile Include="..\WPF\MapItemsControl.WPF.cs" Link="MapItemsControl.WPF.cs" />
<Compile Include="..\WPF\MapMultiPolygon.WPF.cs" Link="MapMultiPolygon.WPF.cs" />
<Compile Include="..\WPF\MapOverlay.WPF.cs" Link="MapOverlay.WPF.cs" />
<Compile Include="..\WPF\MapPanel.WPF.cs" Link="MapPanel.WPF.cs" />
<Compile Include="..\WPF\MapShape.WPF.cs" Link="MapShape.WPF.cs" />
<Compile Include="..\WPF\Tile.WPF.cs" Link="Tile.WPF.cs" />
<Compile Include="..\WPF\TileImageLoader.WPF.cs" Link="TileImageLoader.WPF.cs" />
<Compile Include="..\WPF\TypeConverters.WPF.cs" Link="TypeConverters.WPF.cs" />
<Compile Include="..\WPF\XmlDocument.WPF.cs" Link="XmlDocument.WPF.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\MapControl.snk" Link="MapControl.snk" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Caching" Version="4.6.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Page Update="Themes\Generic.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View file

@ -0,0 +1,67 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl">
<Style TargetType="map:MapItemsControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ItemsPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<map:MapPanel/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="map:MapItem">
<Setter Property="Focusable" Value="False"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="map:MapItem">
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="map:Pushpin">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="map:Pushpin">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle Fill="{TemplateBinding Background}"/>
<Path Grid.Row="1" Fill="{TemplateBinding Background}" Data="M 0,-0.5 L 0,16 16,-0.5"/>
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View file

@ -186,9 +186,11 @@ namespace MapControl.Caching
stream.Write(BitConverter.GetBytes(imageCacheItem.Expiration.Ticks), 0, 8); stream.Write(BitConverter.GetBytes(imageCacheItem.Expiration.Ticks), 0, 8);
} }
#if !NET_CORE
var fileSecurity = File.GetAccessControl(path); var fileSecurity = File.GetAccessControl(path);
fileSecurity.AddAccessRule(fullControlRule); fileSecurity.AddAccessRule(fullControlRule);
File.SetAccessControl(path, fileSecurity); File.SetAccessControl(path, fileSecurity);
#endif
} }
catch (Exception ex) catch (Exception ex)
{ {

View file

@ -8,8 +8,8 @@ using System.Windows;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -51,7 +51,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -57,7 +57,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
<PackageReference Include="ProjNET4GeoAPI"> <PackageReference Include="ProjNET4GeoAPI">
<Version>1.4.1</Version> <Version>1.4.1</Version>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -49,7 +49,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
<PackageReference Include="System.Data.SQLite.Core"> <PackageReference Include="System.Data.SQLite.Core">
<Version>1.0.111</Version> <Version>1.0.111</Version>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -152,7 +152,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.8</Version> <Version>6.2.9</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' "> <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.13.1")] [assembly: AssemblyVersion("4.14.0")]
[assembly: AssemblyFileVersion("4.13.1")] [assembly: AssemblyFileVersion("4.14.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -0,0 +1,7 @@
<Application x:Class="WpfCoreApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View file

@ -0,0 +1,8 @@
using System.Windows;
namespace WpfApplication
{
public partial class App : Application
{
}
}

View file

@ -0,0 +1,36 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using MapControl;
namespace WpfCoreApp
{
public class LocationToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var visibility = Visibility.Hidden;
if (values.Length == 2 && values[0] is MapBase && values[1] is Point?)
{
var parentMap = (MapBase)values[0];
var position = (Point?)values[1];
if (position.HasValue &&
position.Value.X >= 0d && position.Value.X <= parentMap.ActualWidth &&
position.Value.Y >= 0d && position.Value.Y <= parentMap.ActualHeight)
{
visibility = Visibility.Visible;
}
}
return visibility;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

View file

@ -0,0 +1,224 @@
<Window x:Class="WpfCoreApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF.Core"
xmlns:vm="clr-namespace:ViewModel"
xmlns:local="clr-namespace:WpfCoreApp"
mc:Ignorable="d"
Title="MainWindow" Height="600" Width="800">
<Window.Resources>
<local:LocationToVisibilityConverter x:Key="LocationToVisibilityConverter"/>
<DataTemplate x:Key="PolylineItemTemplate">
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
</DataTemplate>
<Style x:Key="PolylineItemStyle" TargetType="map:MapItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="map:MapItem">
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
<!--<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>-->
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="map:MapItem">
<Canvas>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="labelBackground" Storyboard.TargetProperty="Opacity" To="0.7" Duration="0:0:0.1"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.7" Duration="0:0:0.1"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="selectedPath" Fill="White" Opacity="0">
<Path.Data>
<EllipseGeometry RadiusX="15" RadiusY="15"/>
</Path.Data>
</Path>
<Path StrokeThickness="2" Fill="Transparent">
<Path.Stroke>
<SolidColorBrush Color="Gray"/>
</Path.Stroke>
<Path.Data>
<EllipseGeometry RadiusX="8" RadiusY="8"/>
</Path.Data>
</Path>
<Grid Canvas.Left="15" Canvas.Top="-8">
<Rectangle x:Name="labelBackground" Fill="White" Opacity="0"/>
<local:OutlinedText Margin="1" OutlineThickness="1.5" Text="{Binding Name}"/>
</Grid>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="1"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource LocationToVisibilityConverter}">
<Binding Path="(map:MapPanel.ParentMap)" RelativeSource="{RelativeSource Self}"/>
<Binding Path="(map:MapPanel.ViewportPosition)" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="map:MapItem">
<map:Pushpin Content="{Binding Name}" Foreground="{TemplateBinding Foreground}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Foreground" Value="OrangeRed"/>
</Trigger>
</Style.Triggers>
</Style>
<map:WebMercatorProjection x:Key="WebMercatorProjection"/>
<map:WorldMercatorProjection x:Key="WorldMercatorProjection"/>
<map:EquirectangularProjection x:Key="EquirectangularProjection"/>
<map:OrthographicProjection x:Key="OrthographicProjection"/>
<map:GnomonicProjection x:Key="GnomonicProjection"/>
<map:StereographicProjection x:Key="StereographicProjection"/>
</Window.Resources>
<Window.DataContext>
<vm:MapViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<map:Map x:Name="map" ZoomLevel="11" MaxZoomLevel="21"
Center="{Binding MapCenter}"
MapLayer="{Binding MapLayers.CurrentMapLayer}"
MapProjection="{Binding SelectedValue, ElementName=projectionComboBox,
FallbackValue={StaticResource WebMercatorProjection},
TargetNullValue={StaticResource WebMercatorProjection}}"
MouseLeftButtonDown="MapMouseLeftButtonDown"
MouseRightButtonDown="MapMouseRightButtonDown"
MouseMove="MapMouseMove" MouseLeave="MapMouseLeave"
ManipulationInertiaStarting="MapManipulationInertiaStarting">
<Image x:Name="mapImage" Source="10_535_330.jpg" Opacity="0.5" Stretch="Fill"
map:MapPanel.BoundingBox="53.54031,8.08594,53.74871,8.43750"/>
<map:MapGraticule x:Name="mapGraticule" Opacity="0.6"/>
<map:MapScale HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
<!-- use ItemTemplate or ItemContainerStyle alternatively -->
<map:MapItemsControl ItemsSource="{Binding Polylines}"
ItemTemplate="{StaticResource PolylineItemTemplate}"/>
<!--<map:MapItemsControl ItemsSource="{Binding Polylines}"
ItemContainerStyle="{StaticResource PolylineItemStyle}"/>-->
<map:MapItemsControl ItemsSource="{Binding Points}"
ItemContainerStyle="{StaticResource PointItemStyle}"
SelectionMode="Extended"/>
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
ItemContainerStyle="{StaticResource PushpinItemStyle}"/>
<map:Pushpin map:MapPanel.Location="65,-18" Content="Iceland"/>
<map:Pushpin map:MapPanel.Location="71,25" Content="Norway"/>
<map:Pushpin map:MapPanel.Location="35,33" Content="Cyprus"/>
<map:Pushpin map:MapPanel.Location="28.25,-16.5" Content="Tenerife"/>
<Path map:MapPanel.Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
<Path.Data>
<EllipseGeometry RadiusX="1852" RadiusY="1852" Transform="{Binding ScaleRotateTransform, ElementName=map}"/>
</Path.Data>
</Path>
<map:Pushpin map:MapPanel.Location="53.5,8.2" Background="Yellow" Foreground="Blue" Content="N 53°30' E 8°12'">
<map:Pushpin.Visibility>
<MultiBinding Converter="{StaticResource LocationToVisibilityConverter}">
<Binding Path="(map:MapPanel.ParentMap)" RelativeSource="{RelativeSource Self}"/>
<Binding Path="(map:MapPanel.ViewportPosition)" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</map:Pushpin.Visibility>
</map:Pushpin>
</map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#7FFFFFFF">
<TextBlock Margin="2" FontSize="10" map:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="mouseLocation" Margin="5" VerticalAlignment="Bottom" FontFamily="Segoe UI Mono"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Margin="5">
<TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
<Slider ToolTip="Zoom Level" Width="100" VerticalAlignment="Center" SmallChange="0.01"
Minimum="{Binding MinZoomLevel, ElementName=map}"
Maximum="{Binding MaxZoomLevel, ElementName=map}"
Value="{Binding TargetZoomLevel, ElementName=map}"/>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Text="Heading" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
<Slider ToolTip="Heading" Width="100" VerticalAlignment="Center" SmallChange="5" LargeChange="45"
Minimum="0" Maximum="360" Value="{Binding TargetHeading, ElementName=map}"/>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Text="Image Opacity" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
<Slider ToolTip="Image Opacity" Width="100" VerticalAlignment="Center"
Minimum="0" Maximum="1" Value="{Binding Opacity, ElementName=mapImage}"/>
</StackPanel>
<CheckBox ToolTip="Seamarks Overlay" Margin="7" VerticalAlignment="Bottom" Content="Seamarks"
Checked="SeamarksChecked" Unchecked="SeamarksUnchecked"/>
<ComboBox ToolTip="Map Layer" Width="200" Margin="5" VerticalAlignment="Bottom"
ItemsSource="{Binding MapLayers.MapLayerNames}"
SelectedItem="{Binding MapLayers.CurrentMapLayerName}"/>
<ComboBox x:Name="projectionComboBox" ToolTip="Map Projection" Width="120" Margin="5" VerticalAlignment="Bottom"
SelectedValuePath="Tag" SelectedIndex="0">
<ComboBoxItem Content="Web Mercator" Tag="{StaticResource WebMercatorProjection}"/>
<ComboBoxItem Content="World Mercator" Tag="{StaticResource WorldMercatorProjection}"/>
<ComboBoxItem Content="Equirectangular" Tag="{StaticResource EquirectangularProjection}"/>
<ComboBoxItem Content="Orthographic" Tag="{StaticResource OrthographicProjection}"/>
<ComboBoxItem Content="Gnomonic" Tag="{StaticResource GnomonicProjection}"/>
<ComboBoxItem Content="Stereographic" Tag="{StaticResource StereographicProjection}"/>
</ComboBox>
</StackPanel>
</Grid>
</Grid>
</Window>

View file

@ -0,0 +1,91 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Input;
using MapControl;
using ViewModel;
namespace WpfCoreApp
{
public partial class MainWindow : Window
{
public MainWindow()
{
ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application");
TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
InitializeComponent();
}
private void MapMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount == 2)
{
//map.ZoomMap(e.GetPosition(map), Math.Floor(map.ZoomLevel + 1.5));
//map.ZoomToBounds(new BoundingBox(53, 7, 54, 9));
map.TargetCenter = map.ViewportPointToLocation(e.GetPosition(map));
}
}
private void MapMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount == 2)
{
//map.ZoomMap(e.GetPosition(map), Math.Ceiling(map.ZoomLevel - 1.5));
}
}
private void MapMouseMove(object sender, MouseEventArgs e)
{
var location = map.ViewportPointToLocation(e.GetPosition(map));
var latitude = (int)Math.Round(location.Latitude * 60000d);
var longitude = (int)Math.Round(Location.NormalizeLongitude(location.Longitude) * 60000d);
var latHemisphere = 'N';
var lonHemisphere = 'E';
if (latitude < 0)
{
latitude = -latitude;
latHemisphere = 'S';
}
if (longitude < 0)
{
longitude = -longitude;
lonHemisphere = 'W';
}
mouseLocation.Text = string.Format(CultureInfo.InvariantCulture,
"{0} {1:00} {2:00.000}\n{3} {4:000} {5:00.000}",
latHemisphere, latitude / 60000, (latitude % 60000) / 1000d,
lonHemisphere, longitude / 60000, (longitude % 60000) / 1000d);
}
private void MapMouseLeave(object sender, MouseEventArgs e)
{
mouseLocation.Text = string.Empty;
}
private void MapManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
{
e.TranslationBehavior.DesiredDeceleration = 0.001;
}
private void MapItemTouchDown(object sender, TouchEventArgs e)
{
var mapItem = (MapItem)sender;
mapItem.IsSelected = !mapItem.IsSelected;
e.Handled = true;
}
private void SeamarksChecked(object sender, RoutedEventArgs e)
{
map.Children.Insert(map.Children.IndexOf(mapGraticule), ((MapViewModel)DataContext).MapLayers.SeamarksLayer);
}
private void SeamarksUnchecked(object sender, RoutedEventArgs e)
{
map.Children.Remove(((MapViewModel)DataContext).MapLayers.SeamarksLayer);
}
}
}

View file

@ -0,0 +1,145 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WpfCoreApp
{
public class OutlinedText : FrameworkElement
{
private GlyphRun glyphRun;
private Geometry outline;
public static readonly DependencyProperty TextProperty = TextBlock.TextProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty FontSizeProperty = TextBlock.FontSizeProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty FontFamilyProperty = TextBlock.FontFamilyProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty FontStyleProperty = TextBlock.FontStyleProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty FontWeightProperty = TextBlock.FontWeightProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty FontStretchProperty = TextBlock.FontStretchProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty ForegroundProperty = TextBlock.ForegroundProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata((o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty BackgroundProperty = TextBlock.BackgroundProperty.AddOwner(
typeof(OutlinedText), new FrameworkPropertyMetadata(Brushes.White, (o, e) => ((OutlinedText)o).glyphRun = null) { AffectsMeasure = true });
public static readonly DependencyProperty OutlineThicknessProperty = DependencyProperty.Register(
"OutlineThickness", typeof(double), typeof(OutlinedText),
new FrameworkPropertyMetadata(1d, FrameworkPropertyMetadataOptions.AffectsMeasure, (o, e) => ((OutlinedText)o).glyphRun = null));
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
public double FontSize
{
get { return (double)GetValue(FontSizeProperty); }
set { SetValue(FontSizeProperty, value); }
}
public FontFamily FontFamily
{
get { return (FontFamily)GetValue(FontFamilyProperty); }
set { SetValue(FontFamilyProperty, value); }
}
public FontStyle FontStyle
{
get { return (FontStyle)GetValue(FontStyleProperty); }
set { SetValue(FontStyleProperty, value); }
}
public FontWeight FontWeight
{
get { return (FontWeight)GetValue(FontWeightProperty); }
set { SetValue(FontWeightProperty, value); }
}
public FontStretch FontStretch
{
get { return (FontStretch)GetValue(FontStretchProperty); }
set { SetValue(FontStretchProperty, value); }
}
public Brush Foreground
{
get { return (Brush)GetValue(ForegroundProperty); }
set { SetValue(ForegroundProperty, value); }
}
public Brush Background
{
get { return (Brush)GetValue(BackgroundProperty); }
set { SetValue(BackgroundProperty, value); }
}
public double OutlineThickness
{
get { return (double)GetValue(OutlineThicknessProperty); }
set { SetValue(OutlineThicknessProperty, value); }
}
protected override Size MeasureOverride(Size availableSize)
{
return CheckGlyphRun() ? outline.Bounds.Size : new Size();
}
protected override void OnRender(DrawingContext drawingContext)
{
if (CheckGlyphRun())
{
var location = outline.Bounds.Location;
drawingContext.PushTransform(new TranslateTransform(-location.X, -location.Y));
drawingContext.DrawGeometry(Background, null, outline);
drawingContext.DrawGlyphRun(Foreground, glyphRun);
}
}
private bool CheckGlyphRun()
{
if (glyphRun == null)
{
if (string.IsNullOrEmpty(Text))
{
return false;
}
var typeface = new Typeface(FontFamily, FontStyle, FontWeight, FontStretch);
GlyphTypeface glyphTypeface;
if (!typeface.TryGetGlyphTypeface(out glyphTypeface))
{
return false;
}
var glyphIndices = new ushort[Text.Length];
var advanceWidths = new double[Text.Length];
for (int i = 0; i < Text.Length; i++)
{
var glyphIndex = glyphTypeface.CharacterToGlyphMap[Text[i]];
glyphIndices[i] = glyphIndex;
advanceWidths[i] = glyphTypeface.AdvanceWidths[glyphIndex] * FontSize;
}
glyphRun = new GlyphRun(glyphTypeface, 0, false, FontSize, 1f, glyphIndices, new Point(), advanceWidths, null, null, null, null, null, null);
outline = glyphRun.BuildGeometry().GetWidenedPathGeometry(new Pen(null, OutlineThickness * 2d));
}
return true;
}
}
}

View file

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWPF>true</UseWPF>
<RootNamespace>WpfCoreApp</RootNamespace>
<Version>4.14.0</Version>
<Authors>Clemens Fischer</Authors>
<Product>XAML Map Control</Product>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\MapLayers.cs" Link="MapLayers.cs" />
<Compile Include="..\Shared\MapViewModel.cs" Link="MapViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Shared\10_535_330.jpg" Link="10_535_330.jpg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\MapControl\WPF.Core\MapControl.WPF.Core.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<ApplicationDefinition Update="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Page Update="MainWindow.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>