mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-30 20:34:38 +01:00
Fixed LatLonBox rotation
This commit is contained in:
parent
7208cc71bd
commit
ceb19a9ae4
|
|
@ -306,7 +306,9 @@ namespace MapControl
|
|||
element.Height = viewRect.Height;
|
||||
element.Arrange(viewRect);
|
||||
|
||||
rotation += parentMap.ViewTransform.Rotation;
|
||||
// LatLonBoxToMap rotation is counterclockwise, RotateTransform is clockwise.
|
||||
//
|
||||
rotation = (parentMap.ViewTransform.Rotation - rotation) % 360d;
|
||||
|
||||
if (element.RenderTransform is RotateTransform rotateTransform)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -193,11 +193,11 @@ namespace MapControl
|
|||
// Additional rotation caused by the projection, calculated as mean value
|
||||
// of the two angles measured relative to the east and north axis.
|
||||
//
|
||||
var r1 = (Math.Atan2(dy1, dx1) * 180d / Math.PI + 180d) % 360d - 180d;
|
||||
var r2 = (Math.Atan2(-dx2, dy2) * 180d / Math.PI + 180d) % 360d - 180d;
|
||||
var r1 = Math.Atan2(dy1, dx1) * 180d / Math.PI;
|
||||
var r2 = Math.Atan2(-dx2, dy2) * 180d / Math.PI;
|
||||
|
||||
rect = new Rect(x, y, width, height);
|
||||
rotation = latLonBox.Rotation + (r1 + r2) / 2d;
|
||||
rotation = latLonBox.Rotation + (r1 + r2) / 2d % 360d;
|
||||
}
|
||||
|
||||
return (rect, rotation);
|
||||
|
|
|
|||
Loading…
Reference in a new issue