protected string LocationToString(MapPoint location, CoordinateFormat coordinateFormat)
{
switch (coordinateFormat)
{
case CoordinateFormat.DecimalDegrees:
return ConvertCoordinate.ToDecimalDegrees(location, 5);
case CoordinateFormat.DegreesDecimalMinutes:
return ConvertCoordinate.ToDegreesDecimalMinutes(location, 3);
case CoordinateFormat.Dms:
return ConvertCoordinate.ToDegreesMinutesSeconds(location, 1);
case CoordinateFormat.Mgrs:
return ConvertCoordinate.ToMgrs(location, MgrsConversionMode.Automatic, 5, true, true);
}
return null;
}