mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 00:14:51 +00:00
Update MapProjection and ViewTransform
This commit is contained in:
parent
2a9e112a20
commit
eee71e9190
12 changed files with 34 additions and 38 deletions
|
|
@ -2,6 +2,8 @@
|
|||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
#elif UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
|
@ -182,7 +184,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public Point GetMapScale(double latitude, double longitude)
|
||||
{
|
||||
var relativeScale = MapProjection.GetRelativeScale(latitude, longitude);
|
||||
var relativeScale = MapProjection.RelativeScale(latitude, longitude);
|
||||
|
||||
return new Point(ViewTransform.Scale * relativeScale.X, ViewTransform.Scale * relativeScale.Y);
|
||||
}
|
||||
|
|
@ -193,9 +195,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public Point GetMapScale(Location location)
|
||||
{
|
||||
var relativeScale = MapProjection.GetRelativeScale(location);
|
||||
|
||||
return new Point(ViewTransform.Scale * relativeScale.X, ViewTransform.Scale * relativeScale.Y);
|
||||
return GetMapScale(location.Latitude, location.Longitude);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -204,7 +204,12 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public Matrix GetMapTransform(Location location)
|
||||
{
|
||||
return ViewTransform.GetMapTransform(MapProjection.GetRelativeScale(location));
|
||||
var mapScale = GetMapScale(location);
|
||||
var transform = new Matrix(mapScale.X, 0d, 0d, mapScale.Y, 0d, 0d);
|
||||
|
||||
transform.Rotate(ViewTransform.Rotation);
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue