mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-02-07 16:24:19 +01:00
Removed MapProjection.MeterPerDegree
This commit is contained in:
parent
4ad9f2ea2a
commit
d790200cf1
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue