mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Updated MapProjection
This commit is contained in:
parent
0d556e6b14
commit
5d8f1b5ff0
3 changed files with 11 additions and 7 deletions
|
|
@ -114,9 +114,9 @@ namespace MapControl
|
|||
/// Transforms a LatLonBox in geographic coordinates to a rotated Rect in projected map coordinates.
|
||||
/// Returns null when the LatLonBox can not be transformed.
|
||||
/// </summary>
|
||||
public virtual Tuple<Rect, double> LatLonBoxToMap(LatLonBox latLonBox)
|
||||
public virtual (Rect, double)? LatLonBoxToMap(LatLonBox latLonBox)
|
||||
{
|
||||
Tuple<Rect, double> rotatedRect = null;
|
||||
(Rect, double)? rotatedRect = null;
|
||||
Point? center, north, south, west, east;
|
||||
var centerLatitude = latLonBox.Center.Latitude;
|
||||
var centerLongitude = latLonBox.Center.Longitude;
|
||||
|
|
@ -142,7 +142,7 @@ namespace MapControl
|
|||
var r1 = (Math.Atan2(dy1, dx1) * 180d / Math.PI + 180d) % 360d - 180d;
|
||||
var r2 = (Math.Atan2(-dx2, dy2) * 180d / Math.PI + 180d) % 360d - 180d;
|
||||
|
||||
rotatedRect = new Tuple<Rect, double>(new Rect(x, y, width, height), latLonBox.Rotation + (r1 + r2) / 2d);
|
||||
rotatedRect = (new Rect(x, y, width, height), latLonBox.Rotation + (r1 + r2) / 2d);
|
||||
}
|
||||
|
||||
return rotatedRect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue