mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Cleanup
This commit is contained in:
parent
b0b4e0ea89
commit
d916278845
4 changed files with 22 additions and 29 deletions
|
|
@ -25,8 +25,6 @@ namespace MapControl
|
|||
public const double Wgs84EquatorialRadius = 6378137d;
|
||||
public const double MetersPerDegree = Wgs84EquatorialRadius * Math.PI / 180d;
|
||||
|
||||
private Matrix inverseViewportTransformMatrix;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the WMS 1.3.0 CRS Identifier.
|
||||
/// </summary>
|
||||
|
|
@ -58,6 +56,11 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public Matrix ViewportTransform { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the transform matrix from viewport coordinates to cartesian map coordinates (pixels).
|
||||
/// </summary>
|
||||
public Matrix InverseViewportTransform { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scaling factor from cartesian map coordinates to viewport coordinates.
|
||||
/// </summary>
|
||||
|
|
@ -115,7 +118,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public Location ViewportPointToLocation(Point point)
|
||||
{
|
||||
return PointToLocation(inverseViewportTransformMatrix.Transform(point));
|
||||
return PointToLocation(InverseViewportTransform.Transform(point));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -123,7 +126,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public BoundingBox ViewportRectToBoundingBox(Rect rect)
|
||||
{
|
||||
var transform = new MatrixTransform { Matrix = inverseViewportTransformMatrix };
|
||||
var transform = new MatrixTransform { Matrix = InverseViewportTransform };
|
||||
|
||||
return RectToBoundingBox(transform.TransformBounds(rect));
|
||||
}
|
||||
|
|
@ -139,9 +142,8 @@ namespace MapControl
|
|||
var matrix = CreateTransformMatrix(center, ViewportScale, -ViewportScale, heading, viewportCenter);
|
||||
|
||||
ViewportTransform = matrix;
|
||||
|
||||
matrix.Invert();
|
||||
inverseViewportTransformMatrix = matrix;
|
||||
InverseViewportTransform = matrix;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue