mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Reworked MapProjection
Return nullable Point from LocationToMap. Use MapRect instead of WinUI/UWP Rect replacement. Drop Vector. Add Scale struct.
This commit is contained in:
parent
bab1788334
commit
218a85316c
28 changed files with 249 additions and 324 deletions
|
|
@ -26,16 +26,16 @@ namespace MapControl
|
|||
CrsId = DefaultCrsId;
|
||||
}
|
||||
|
||||
public override Vector GetRelativeScale(Location location)
|
||||
public override Scale GetRelativeScale(Location location)
|
||||
{
|
||||
var lat = location.Latitude * Math.PI / 180d;
|
||||
var eSinLat = Wgs84Eccentricity * Math.Sin(lat);
|
||||
var k = Math.Sqrt(1d - eSinLat * eSinLat) / Math.Cos(lat); // p.44 (7-8)
|
||||
|
||||
return new Vector(k, k);
|
||||
return new Scale(k, k);
|
||||
}
|
||||
|
||||
public override Point LocationToMap(Location location)
|
||||
public override Point? LocationToMap(Location location)
|
||||
{
|
||||
return new Point(
|
||||
Wgs84MeterPerDegree * location.Longitude,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue