Version 4.6.1: Removed obsolete MapProjection.TranslateLocation method

This commit is contained in:
ClemensFischer 2018-03-06 23:24:25 +01:00
parent fa2c561bc9
commit b12155e498
15 changed files with 19 additions and 73 deletions

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[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("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[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("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[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("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -30,16 +30,6 @@ namespace MapControl
return new Point(ViewportScale, ViewportScale); return new Point(ViewportScale, ViewportScale);
} }
public override Location TranslateLocation(Location location, Point translation)
{
var scaleY = ViewportScale * TrueScale;
var scaleX = scaleY * Math.Cos(location.Latitude * Math.PI / 180d);
return new Location(
location.Latitude - translation.Y / scaleY,
location.Longitude + translation.X / scaleX);
}
public override Rect BoundingBoxToRect(BoundingBox boundingBox) public override Rect BoundingBoxToRect(BoundingBox boundingBox)
{ {
var cbbox = boundingBox as CenteredBoundingBox; var cbbox = boundingBox as CenteredBoundingBox;

View file

@ -42,12 +42,5 @@ namespace MapControl
{ {
return new Location(point.Y, point.X); return new Location(point.Y, point.X);
} }
public override Location TranslateLocation(Location location, Point translation)
{
return new Location(
location.Latitude - translation.Y / ViewportScale,
location.Longitude + translation.X / ViewportScale);
}
} }
} }

View file

@ -288,20 +288,8 @@ namespace MapControl
if (translation.X != 0d || translation.Y != 0d) if (translation.X != 0d || translation.Y != 0d)
{ {
if (Heading != 0d) Center = MapProjection.ViewportPointToLocation(
{ new Point(viewportCenter.X - translation.X, viewportCenter.Y - translation.Y));
var cos = Math.Cos(Heading * Math.PI / 180d);
var sin = Math.Sin(Heading * Math.PI / 180d);
translation = new Point(
translation.X * cos + translation.Y * sin,
translation.Y * cos - translation.X * sin);
}
translation.X = -translation.X;
translation.Y = -translation.Y;
Center = MapProjection.TranslateLocation(Center, translation);
} }
} }

View file

@ -88,11 +88,6 @@ namespace MapControl
/// </summary> /// </summary>
public abstract Location PointToLocation(Point point); public abstract Location PointToLocation(Point point);
/// <summary>
/// Translates a Location in geographic coordinates by the specified small amount in viewport coordinates.
/// </summary>
public abstract Location TranslateLocation(Location location, Point translation);
/// <summary> /// <summary>
/// Transforms a BoundingBox in geographic coordinates to a Rect in cartesian map coordinates. /// Transforms a BoundingBox in geographic coordinates to a Rect in cartesian map coordinates.
/// </summary> /// </summary>

View file

@ -50,16 +50,6 @@ namespace MapControl
point.X / TrueScale); point.X / TrueScale);
} }
public override Location TranslateLocation(Location location, Point translation)
{
var scaleX = TrueScale * ViewportScale;
var scaleY = scaleX / Math.Cos(location.Latitude * Math.PI / 180d);
return new Location(
location.Latitude - translation.Y / scaleY,
location.Longitude + translation.X / scaleX);
}
public static double LatitudeToY(double latitude) public static double LatitudeToY(double latitude)
{ {
if (latitude <= -90d) if (latitude <= -90d)

View file

@ -57,16 +57,6 @@ namespace MapControl
point.X / TrueScale); point.X / TrueScale);
} }
public override Location TranslateLocation(Location location, Point translation)
{
var scaleX = TrueScale * ViewportScale;
var scaleY = scaleX / Math.Cos(location.Latitude * Math.PI / 180d);
return new Location(
location.Latitude - translation.Y / scaleY,
location.Longitude + translation.X / scaleX);
}
public static double LatitudeToY(double latitude) public static double LatitudeToY(double latitude)
{ {
if (latitude <= -90d) if (latitude <= -90d)

View file

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

View file

@ -8,8 +8,8 @@ using System.Windows;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[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("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -156,7 +156,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.0.7</Version> <Version>6.0.8</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("© 2018 Clemens Fischer")] [assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.6.0")] [assembly: AssemblyVersion("4.6.1")]
[assembly: AssemblyFileVersion("4.6.0")] [assembly: AssemblyFileVersion("4.6.1")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]