mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
TypeConverter for MapProjection
This commit is contained in:
parent
de6bc52d10
commit
17a481c773
2 changed files with 45 additions and 4 deletions
|
|
@ -19,6 +19,11 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// Defines a map projection between geographic coordinates and cartesian map coordinates.
|
||||
/// </summary>
|
||||
#if UWP || WINUI
|
||||
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
|
||||
#else
|
||||
[System.ComponentModel.TypeConverter(typeof(MapProjectionConverter))]
|
||||
#endif
|
||||
public abstract class MapProjection
|
||||
{
|
||||
public const double Wgs84EquatorialRadius = 6378137d;
|
||||
|
|
@ -131,5 +136,18 @@ namespace MapControl
|
|||
|
||||
return rotatedRect;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return CrsId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a MapProjection instance from a CRS id string.
|
||||
/// </summary>
|
||||
public static MapProjection Parse(string crsId)
|
||||
{
|
||||
return MapProjectionFactory.Instance.GetProjection(crsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue