diff --git a/MapControl/Shared/MapPanel.cs b/MapControl/Shared/MapPanel.cs index ca335af4..c554759e 100644 --- a/MapControl/Shared/MapPanel.cs +++ b/MapControl/Shared/MapPanel.cs @@ -229,15 +229,14 @@ namespace MapControl element.Arrange(rect); var rotateTransform = element.RenderTransform as RotateTransform; - var rotation = parentMap.ViewTransform.Rotation; if (rotateTransform != null) { - rotateTransform.Angle = rotation; + rotateTransform.Angle = parentMap.ViewTransform.Rotation; } - else if (rotation != 0d) + else if (parentMap.ViewTransform.Rotation != 0d) { - rotateTransform = new RotateTransform { Angle = rotation }; + rotateTransform = new RotateTransform { Angle = parentMap.ViewTransform.Rotation }; element.RenderTransform = rotateTransform; element.RenderTransformOrigin = new Point(0.5, 0.5); } diff --git a/MapControl/Shared/MapPath.cs b/MapControl/Shared/MapPath.cs index 4a311cde..3038f76a 100644 --- a/MapControl/Shared/MapPath.cs +++ b/MapControl/Shared/MapPath.cs @@ -100,7 +100,7 @@ namespace MapControl var viewPos = LocationToView(Location); var scale = parentMap.GetScale(Location); var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d); - transform.Rotate(parentMap.Heading); + transform.Rotate(parentMap.ViewTransform.Rotation); transform.Translate(viewPos.X, viewPos.Y); dataTransform.Matrix = transform; }