Version 5.0: Reworked MapBase and MapPath

This commit is contained in:
ClemensF 2020-03-28 21:53:38 +01:00
parent 06fd31c17b
commit 49e15ce424
41 changed files with 466 additions and 1068 deletions

View file

@ -1,12 +1,11 @@
<Window
x:Class="WpfApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF"
xmlns:vm="clr-namespace:ViewModel"
xmlns:local="clr-namespace:WpfApplication"
Title="XAML MapControl - WPF Test Application" Height="600" Width="800"
Stylus.IsPressAndHoldEnabled="False">
<Window x:Class="WpfApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF"
xmlns:vm="clr-namespace:ViewModel"
xmlns:local="clr-namespace:WpfApplication"
Title="XAML MapControl - WPF Test Application" Height="600" Width="900"
Stylus.IsPressAndHoldEnabled="False">
<Window.Resources>
<local:LocationToVisibilityConverter x:Key="LocationToVisibilityConverter"/>
@ -88,7 +87,7 @@
<Setter.Value>
<MultiBinding Converter="{StaticResource LocationToVisibilityConverter}">
<Binding Path="(map:MapPanel.ParentMap)" RelativeSource="{RelativeSource Self}"/>
<Binding Path="(map:MapPanel.ViewportPosition)" RelativeSource="{RelativeSource Self}"/>
<Binding Path="(map:MapPanel.ViewPosition)" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</Setter.Value>
</Setter>
@ -159,17 +158,17 @@
<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:MapPath Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
<map:MapPath.Data>
<EllipseGeometry RadiusX="1852" RadiusY="1852"/>
</map:MapPath.Data>
</map:MapPath>
<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}"/>
<Binding Path="(map:MapPanel.ViewPosition)" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</map:Pushpin.Visibility>
</map:Pushpin>

View file

@ -12,7 +12,7 @@ namespace WpfApplication
public MainWindow()
{
ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application");
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new MapControl.Caching.FileDbCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new MapControl.Caching.SQLiteCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = null;
@ -26,7 +26,7 @@ namespace WpfApplication
{
//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));
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));
}
}
@ -40,7 +40,7 @@ namespace WpfApplication
private void MapMouseMove(object sender, MouseEventArgs e)
{
var location = map.ViewportPointToLocation(e.GetPosition(map));
var location = map.ViewToLocation(e.GetPosition(map));
var latitude = (int)Math.Round(location.Latitude * 60000d);
var longitude = (int)Math.Round(Location.NormalizeLongitude(location.Longitude) * 60000d);
var latHemisphere = 'N';

View file

@ -1,14 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("WPF Sample Application")]
[assembly: AssemblyDescription("XAML Map Control WPF Sample Application")]
[assembly: AssemblyProduct("XAML Map Control")]
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("5.0.0")]
[assembly: AssemblyFileVersion("5.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -1,110 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.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>{F92DA93D-75DB-4308-A5F9-6B4C3908A675}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WpfApplication</RootNamespace>
<AssemblyName>WpfApplication</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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</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>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="..\Shared\MapLayers.cs">
<Link>MapLayers.cs</Link>
</Compile>
<Compile Include="..\Shared\MapViewModel.cs">
<Link>MapViewModel.cs</Link>
</Compile>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="LocationToVisibilityConverter.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="OutlinedText.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Shared\10_535_330.jpg">
<Link>10_535_330.jpg</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\MapControl\WPF\MapControl.WPF.csproj">
<Project>{62f1726b-3144-49f4-8bcc-94160a3b2186}</Project>
<Name>MapControl.WPF</Name>
</ProjectReference>
<ProjectReference Include="..\..\SQLiteCache\WPF\SQLiteCache.WPF.csproj">
<Project>{0109c2f0-ba2c-420f-b2ca-db5b29b1a349}</Project>
<Name>SQLiteCache.WPF</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.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 Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>netcoreapp3.1;net48</TargetFrameworks>
<UseWPF>true</UseWPF>
<RootNamespace>WpfApplication</RootNamespace>
<Product>XAML Map Control</Product>
<Version>5.0.0</Version>
<Description>XAML Map Control WPF Sample Application</Description>
<Authors>Clemens Fischer</Authors>
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants></DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\MapLayers.cs" Link="MapLayers.cs" />
<Compile Include="..\Shared\MapViewModel.cs" Link="MapViewModel.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\MapControl\WPF\MapControl.WPF.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Shared\10_535_330.jpg" Link="10_535_330.jpg" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Caching" />
</ItemGroup>
</Project>

View file

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