mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Fixed MapItem.MapTransform implementation
This commit is contained in:
parent
d7593cbe8c
commit
fd13503613
11 changed files with 229 additions and 127 deletions
|
|
@ -236,6 +236,18 @@ namespace MapControl
|
|||
return ViewTransform.Scale * MapProjection.GetRelativeScale(location);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a transform Matrix for scaling and rotating objects that are anchored
|
||||
/// at a Location from map coordinates (i.e. meters) to view coordinates.
|
||||
/// </summary>
|
||||
public Matrix GetMapTransform(Location location)
|
||||
{
|
||||
var scale = GetScale(location);
|
||||
var matrix = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
|
||||
matrix.Rotate(ViewTransform.Rotation);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a Location in geographic coordinates to a Point in view coordinates.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue