mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 00:14:51 +00:00
Added MapProjectionFactory
This commit is contained in:
parent
67b87acb44
commit
e2fcc1db2c
12 changed files with 87 additions and 17 deletions
51
MapControl/Shared/MapProjectionFactory.cs
Normal file
51
MapControl/Shared/MapProjectionFactory.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2022 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public class MapProjectionFactory
|
||||
{
|
||||
public virtual MapProjection CreateProjection(string projectionDefinition)
|
||||
{
|
||||
MapProjection projection = null;
|
||||
|
||||
switch (projectionDefinition)
|
||||
{
|
||||
case WorldMercatorProjection.DefaultCrsId:
|
||||
projection = new WorldMercatorProjection();
|
||||
break;
|
||||
|
||||
case WebMercatorProjection.DefaultCrsId:
|
||||
projection = new WebMercatorProjection();
|
||||
break;
|
||||
|
||||
case EquirectangularProjection.DefaultCrsId:
|
||||
projection = new EquirectangularProjection();
|
||||
break;
|
||||
|
||||
case OrthographicProjection.DefaultCrsId:
|
||||
projection = new OrthographicProjection();
|
||||
break;
|
||||
|
||||
case AutoEquirectangularProjection.DefaultCrsId:
|
||||
projection = new AutoEquirectangularProjection();
|
||||
break;
|
||||
|
||||
case GnomonicProjection.DefaultCrsId:
|
||||
projection = new GnomonicProjection();
|
||||
break;
|
||||
|
||||
case StereographicProjection.DefaultCrsId:
|
||||
projection = new StereographicProjection();
|
||||
break;
|
||||
|
||||
case "EPSG:97003": // proprietary CRS ID
|
||||
projection = new AzimuthalEquidistantProjection { CrsId = projectionDefinition };
|
||||
break;
|
||||
}
|
||||
|
||||
return projection;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue