mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Version 5.1: Use C# 7
This commit is contained in:
parent
310f0cca9a
commit
7bd1d450dc
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -2,4 +2,13 @@
|
|||
bin/
|
||||
obj/
|
||||
packages/
|
||||
TestApps/
|
||||
Win2D/
|
||||
MapControl.UWP1.csproj
|
||||
MapControl.WPF.VS2015.csproj
|
||||
MapProjections.WPF.VS2015.csproj
|
||||
MapControl_TestApps.sln
|
||||
MapLayers_ApiKey.cs
|
||||
MergeNugetPackages.cmd
|
||||
*.nupkg
|
||||
*.txt
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>ObjectCache implementation based on EzTools FileDb</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>MBTiles Support Library for XAML Map Control</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public virtual Vector GetRelativeScale(Location location)
|
||||
{
|
||||
return new Vector(1, 1);
|
||||
return new Vector(1d, 1d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace MapControl
|
|||
{
|
||||
public const int TileSize = 256;
|
||||
|
||||
public static readonly Point TileMatrixTopLeft = new Point(
|
||||
public static readonly Point MapTopLeft = new Point(
|
||||
-180d * MapProjection.Wgs84MetersPerDegree, 180d * MapProjection.Wgs84MetersPerDegree);
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -114,8 +114,8 @@ namespace MapControl
|
|||
|
||||
var tileMatrixScale = ViewTransform.ZoomLevelToScale(TileMatrix.ZoomLevel);
|
||||
|
||||
((MatrixTransform)RenderTransform).Matrix = ParentMap.ViewTransform.GetTileLayerTransform(
|
||||
tileMatrixScale, TileMatrixTopLeft, tileMatrixOrigin);
|
||||
((MatrixTransform)RenderTransform).Matrix =
|
||||
ParentMap.ViewTransform.GetTileLayerTransform(tileMatrixScale, MapTopLeft, tileMatrixOrigin);
|
||||
}
|
||||
|
||||
private bool SetTileMatrix()
|
||||
|
|
@ -126,15 +126,14 @@ namespace MapControl
|
|||
|
||||
// bounds in tile pixels from view size
|
||||
//
|
||||
var tileBounds = ParentMap.ViewTransform.GetTileMatrixBounds(
|
||||
tileMatrixScale, TileMatrixTopLeft, ParentMap.RenderSize);
|
||||
var bounds = ParentMap.ViewTransform.GetTileMatrixBounds(tileMatrixScale, MapTopLeft, ParentMap.RenderSize);
|
||||
|
||||
// tile column and row index bounds
|
||||
//
|
||||
var xMin = (int)Math.Floor(tileBounds.X / TileSize);
|
||||
var yMin = (int)Math.Floor(tileBounds.Y / TileSize);
|
||||
var xMax = (int)Math.Floor((tileBounds.X + tileBounds.Width) / TileSize);
|
||||
var yMax = (int)Math.Floor((tileBounds.Y + tileBounds.Height) / TileSize);
|
||||
var xMin = (int)Math.Floor(bounds.X / TileSize);
|
||||
var yMin = (int)Math.Floor(bounds.Y / TileSize);
|
||||
var xMax = (int)Math.Floor((bounds.X + bounds.Width) / TileSize);
|
||||
var yMax = (int)Math.Floor((bounds.Y + bounds.Height) / TileSize);
|
||||
|
||||
if (TileMatrix != null &&
|
||||
TileMatrix.ZoomLevel == tileMatrixZoomLevel &&
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public class WorldMercatorProjection : MapProjection
|
||||
{
|
||||
public static double ConvergenceTolerance = 1e-6;
|
||||
public static int MaxIterations = 10;
|
||||
public static double ConvergenceTolerance { get; set; } = 1e-6;
|
||||
public static int MaxIterations { get; set; } = 10;
|
||||
|
||||
private static readonly double maxLatitude = YToLatitude(180d);
|
||||
|
||||
|
|
@ -72,8 +72,7 @@ namespace MapControl
|
|||
|
||||
var lat = latitude * Math.PI / 180d;
|
||||
|
||||
return Math.Log(Math.Tan(lat / 2d + Math.PI / 4d)
|
||||
* ConformalFactor(lat)) * 180d / Math.PI; // p.44 (7-7)
|
||||
return Math.Log(Math.Tan(lat / 2d + Math.PI / 4d) * ConformalFactor(lat)) * 180d / Math.PI; // p.44 (7-7)
|
||||
}
|
||||
|
||||
public static double YToLatitude(double y)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>XAML Map Control Library</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>Image Support Library for XAML Map Control</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>Map Projections Library for XAML Map Control</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>ObjectCache implementation based on SQLite</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCopyright("Copyright © 2020 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: AssemblyVersion("5.0.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.1")]
|
||||
[assembly: AssemblyVersion("5.1.0")]
|
||||
[assembly: AssemblyFileVersion("5.1.0")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<UseWPF>true</UseWPF>
|
||||
<RootNamespace>WpfApplication</RootNamespace>
|
||||
<Product>XAML Map Control</Product>
|
||||
<Version>5.0.1</Version>
|
||||
<Version>5.1.0</Version>
|
||||
<Description>XAML Map Control WPF Sample Application</Description>
|
||||
<Authors>Clemens Fischer</Authors>
|
||||
<Copyright>Copyright © 2020 Clemens Fischer</Copyright>
|
||||
|
|
|
|||
Loading…
Reference in a new issue