Removed MapProjection.MeterPerDegree

This commit is contained in:
ClemensFischer 2026-01-29 22:31:27 +01:00
parent 4ad9f2ea2a
commit d790200cf1
4 changed files with 14 additions and 12 deletions

View file

@ -35,12 +35,16 @@ namespace MapControl
public override Point LocationToMap(double latitude, double longitude)
{
return new Point(MeterPerDegree * longitude, MeterPerDegree * latitude);
return new Point(
EquatorialRadius * Math.PI / 180d * longitude,
EquatorialRadius * Math.PI / 180d * latitude);
}
public override Location MapToLocation(double x, double y)
{
return new Location(y / MeterPerDegree, x / MeterPerDegree);
return new Location(
y / EquatorialRadius * 180d / Math.PI,
x / EquatorialRadius * 180d / Math.PI);
}
}
}

View file

@ -53,8 +53,6 @@ namespace MapControl
/// </summary>
public double EquatorialRadius { get; set; } = Wgs84EquatorialRadius;
public double MeterPerDegree => EquatorialRadius * Math.PI / 180d;
/// <summary>
/// Gets the relative transform at the specified geographic coordinates.
/// The returned Matrix represents the local relative scale and rotation.

View file

@ -37,15 +37,15 @@ namespace MapControl
public override Point LocationToMap(double latitude, double longitude)
{
return new Point(
MeterPerDegree * longitude,
MeterPerDegree * LatitudeToY(latitude));
EquatorialRadius * Math.PI / 180d * longitude,
EquatorialRadius * Math.PI / 180d * LatitudeToY(latitude));
}
public override Location MapToLocation(double x, double y)
{
return new Location(
YToLatitude(y / MeterPerDegree),
x / MeterPerDegree);
YToLatitude(y / EquatorialRadius * 180d / Math.PI),
x / EquatorialRadius * 180d / Math.PI);
}
public static double LatitudeToY(double latitude)

View file

@ -39,15 +39,15 @@ namespace MapControl
public override Point LocationToMap(double latitude, double longitude)
{
return new Point(
MeterPerDegree * longitude,
MeterPerDegree * LatitudeToY(latitude));
EquatorialRadius * Math.PI / 180d * longitude,
EquatorialRadius * Math.PI / 180d * LatitudeToY(latitude));
}
public override Location MapToLocation(double x, double y)
{
return new Location(
YToLatitude(y / MeterPerDegree),
x / MeterPerDegree);
YToLatitude(y / EquatorialRadius * 180d / Math.PI),
x / EquatorialRadius * 180d / Math.PI);
}
public static double RelativeScale(double latitude)