mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Version 5.0.1: Reworked MapBase and MapProjection
This commit is contained in:
parent
81ec8e7eb2
commit
2b41d298f4
4 changed files with 22 additions and 26 deletions
|
|
@ -19,6 +19,16 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public class ViewTransform
|
||||
{
|
||||
public static double ZoomLevelToScale(double zoomLevel)
|
||||
{
|
||||
return 256d * Math.Pow(2d, zoomLevel) / (360d * MapProjection.Wgs84MetersPerDegree);
|
||||
}
|
||||
|
||||
public static double ScaleToZoomLevel(double scale)
|
||||
{
|
||||
return Math.Log(scale * 360d * MapProjection.Wgs84MetersPerDegree / 256d, 2d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scaling factor from cartesian map coordinates to view coordinates,
|
||||
/// i.e. pixels per meter.
|
||||
|
|
@ -117,15 +127,5 @@ namespace MapControl
|
|||
return new MatrixTransform { Matrix = transform }
|
||||
.TransformBounds(new Rect(0d, 0d, viewSize.Width, viewSize.Height));
|
||||
}
|
||||
|
||||
public static double ZoomLevelToScale(double zoomLevel)
|
||||
{
|
||||
return 256d * Math.Pow(2d, zoomLevel) / (360d * MapProjection.Wgs84MetersPerDegree);
|
||||
}
|
||||
|
||||
public static double ScaleToZoomLevel(double scale)
|
||||
{
|
||||
return Math.Log(scale * 360d * MapProjection.Wgs84MetersPerDegree / 256d, 2d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue