mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update GeoApiProjectionFactory.cs
This commit is contained in:
parent
0d602be611
commit
b921600e1b
|
|
@ -21,17 +21,19 @@ namespace MapControl.Projections
|
|||
public const int Wgs84UtmSouthLast = 32760;
|
||||
public const int Wgs84UpsSouth = 32761;
|
||||
|
||||
public Dictionary<string, string> CoordinateSystemWkts { get; } = new Dictionary<string, string>();
|
||||
public Dictionary<int, string> CoordinateSystemWkts { get; } = new Dictionary<int, string>();
|
||||
|
||||
public override MapProjection GetProjection(string crsId)
|
||||
{
|
||||
MapProjection projection = null;
|
||||
|
||||
if (CoordinateSystemWkts.TryGetValue(crsId, out string wkt))
|
||||
if (crsId.StartsWith("EPSG:") && int.TryParse(crsId.Substring(5), out int epsgCode))
|
||||
{
|
||||
if (CoordinateSystemWkts.TryGetValue(epsgCode, out string wkt))
|
||||
{
|
||||
projection = new GeoApiProjection(wkt);
|
||||
}
|
||||
else if (crsId.StartsWith("EPSG:") && int.TryParse(crsId.Substring(5), out int epsgCode))
|
||||
else
|
||||
{
|
||||
switch (epsgCode)
|
||||
{
|
||||
|
|
@ -71,6 +73,7 @@ namespace MapControl.Projections
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return projection ?? base.GetProjection(crsId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue