mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 07:25:21 +00:00
Version 5.0.1: Dropped MapProjection.UnitsPerDegree
This commit is contained in:
parent
2b41d298f4
commit
43c33c2564
12 changed files with 29 additions and 50 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue