Version 5.0.1: Dropped MapProjection.UnitsPerDegree

This commit is contained in:
ClemensF 2020-04-02 18:06:39 +02:00
parent 2b41d298f4
commit 43c33c2564
12 changed files with 29 additions and 50 deletions

View file

@ -18,19 +18,19 @@ namespace MapControl
public override Point LocationToMap(Location location)
{
var xScale = UnitsPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
var xScale = Wgs84MetersPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
return new Point(
xScale * (location.Longitude - Center.Longitude),
UnitsPerDegree * location.Latitude);
Wgs84MetersPerDegree * location.Latitude);
}
public override Location MapToLocation(Point point)
{
var xScale = UnitsPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
var xScale = Wgs84MetersPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
return new Location(
point.Y / UnitsPerDegree,
point.Y / Wgs84MetersPerDegree,
point.X / xScale + Center.Longitude);
}
}