mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Removed incorrect TransverseMercatorProjection
This commit is contained in:
parent
47ff9096d1
commit
954451fb34
16 changed files with 70 additions and 399 deletions
|
|
@ -21,23 +21,36 @@ namespace MapControl.Projections
|
|||
|
||||
public override MapProjection GetProjection(string crsId)
|
||||
{
|
||||
MapProjection projection = null;
|
||||
|
||||
switch (crsId)
|
||||
{
|
||||
case MapControl.WebMercatorProjection.DefaultCrsId:
|
||||
return new WebMercatorProjection();
|
||||
projection = new WebMercatorProjection();
|
||||
break;
|
||||
|
||||
case MapControl.WorldMercatorProjection.DefaultCrsId:
|
||||
return new WorldMercatorProjection();
|
||||
projection = new WorldMercatorProjection();
|
||||
break;
|
||||
|
||||
case MapControl.Wgs84AutoUtmProjection.DefaultCrsId:
|
||||
return new Wgs84AutoUtmProjection();
|
||||
case Wgs84AutoUtmProjection.DefaultCrsId:
|
||||
projection = new Wgs84AutoUtmProjection();
|
||||
break;
|
||||
|
||||
default:
|
||||
return base.GetProjection(crsId);
|
||||
projection = base.GetProjection(crsId);
|
||||
break;
|
||||
}
|
||||
|
||||
if (projection == null && crsId.StartsWith("EPSG:") && int.TryParse(crsId.Substring(5), out int epsgCode))
|
||||
{
|
||||
projection = GetProjection(epsgCode);
|
||||
}
|
||||
|
||||
return projection;
|
||||
}
|
||||
|
||||
public override MapProjection GetProjection(int epsgCode)
|
||||
public virtual MapProjection GetProjection(int epsgCode)
|
||||
{
|
||||
switch (epsgCode)
|
||||
{
|
||||
|
|
@ -62,7 +75,7 @@ namespace MapControl.Projections
|
|||
default:
|
||||
return CoordinateSystemWkts.TryGetValue(epsgCode, out string wkt)
|
||||
? new GeoApiProjection(wkt)
|
||||
: base.GetProjection(epsgCode);
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,11 @@ namespace MapControl.Projections
|
|||
/// </summary>
|
||||
public class Wgs84AutoUtmProjection : Wgs84UtmProjection
|
||||
{
|
||||
public const string DefaultCrsId = "AUTO2:42001";
|
||||
|
||||
private readonly string autoCrsId;
|
||||
|
||||
public Wgs84AutoUtmProjection(string crsId = MapControl.Wgs84AutoUtmProjection.DefaultCrsId)
|
||||
public Wgs84AutoUtmProjection(string crsId = DefaultCrsId)
|
||||
: base(31, true)
|
||||
{
|
||||
autoCrsId = crsId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue