mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Updated projections
This commit is contained in:
parent
da3a9a18fb
commit
91dfeee19c
6 changed files with 49 additions and 43 deletions
|
|
@ -241,7 +241,7 @@ namespace MapControl.Projections
|
|||
{
|
||||
MapControl.WebMercatorProjection.DefaultCrsId => new WebMercatorProjection(),
|
||||
MapControl.WorldMercatorProjection.DefaultCrsId => new WorldMercatorProjection(),
|
||||
MapControl.Wgs84AutoUtmProjection.DefaultCrsId => new Wgs84AutoUtmProjection(),
|
||||
Wgs84AutoUtmProjection.DefaultCrsId => new Wgs84AutoUtmProjection(),
|
||||
_ => base.GetProjection(crsId)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ namespace MapControl.Projections
|
|||
/// </summary>
|
||||
public class Wgs84AutoUtmProjection : Wgs84UtmProjection
|
||||
{
|
||||
public const string DefaultCrsId = "AUTO2:42001";
|
||||
|
||||
private readonly string autoCrsId;
|
||||
|
||||
public Wgs84AutoUtmProjection() // parameterless constructor for XAML
|
||||
: this(MapControl.Wgs84AutoUtmProjection.DefaultCrsId)
|
||||
: this(DefaultCrsId)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
#if WPF
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
|
|
@ -36,9 +35,7 @@ namespace MapControl.Projections
|
|||
|
||||
public override Point RelativeScale(double latitude, double longitude)
|
||||
{
|
||||
var lat = latitude * Math.PI / 180d;
|
||||
var eSinLat = MapControl.WorldMercatorProjection.Wgs84Eccentricity * Math.Sin(lat);
|
||||
var k = Math.Sqrt(1d - eSinLat * eSinLat) / Math.Cos(lat); // p.44 (7-8)
|
||||
var k = MapControl.WorldMercatorProjection.ScaleFactor(latitude);
|
||||
|
||||
return new Point(k, k);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue