Some comments

This commit is contained in:
ClemensFischer 2024-04-11 15:59:07 +02:00
parent e642846e7d
commit fd2f09a078
5 changed files with 17 additions and 4 deletions

View file

@ -44,6 +44,9 @@ namespace MapControl
public virtual Location Center => new Location((South + North) / 2d, (West + East) / 2d); public virtual Location Center => new Location((South + North) / 2d, (West + East) / 2d);
/// <summary>
/// Creates a BoundingBox instance from a string containing a comma-separated sequence of four floating point numbers.
/// </summary>
public static BoundingBox Parse(string boundingBox) public static BoundingBox Parse(string boundingBox)
{ {
string[] values = null; string[] values = null;
@ -55,7 +58,7 @@ namespace MapControl
if (values?.Length != 4) if (values?.Length != 4)
{ {
throw new FormatException("BoundingBox string must be a comma-separated list of four floating point numbers."); throw new FormatException("BoundingBox string must contain a comma-separated sequence of four floating point numbers.");
} }
return new BoundingBox( return new BoundingBox(

View file

@ -52,6 +52,9 @@ namespace MapControl
return string.Format(CultureInfo.InvariantCulture, "{0:F5},{1:F5}", Latitude, Longitude); return string.Format(CultureInfo.InvariantCulture, "{0:F5},{1:F5}", Latitude, Longitude);
} }
/// <summary>
/// Creates a Location instance from a string containing a comma-separated pair of floating point numbers.
/// </summary>
public static Location Parse(string location) public static Location Parse(string location)
{ {
string[] values = null; string[] values = null;
@ -63,7 +66,7 @@ namespace MapControl
if (values?.Length != 2) if (values?.Length != 2)
{ {
throw new FormatException("Location string must be a comma-separated pair of floating point numbers."); throw new FormatException("Location string must contain a comma-separated pair of floating point numbers.");
} }
return new Location( return new Location(

View file

@ -52,6 +52,10 @@ namespace MapControl
Add(new Location(latitude, longitude)); Add(new Location(latitude, longitude));
} }
/// <summary>
/// Creates a LocationCollection instance from a string containing a sequence
/// of Location strings that are separated by a spaces or semicolons.
/// </summary>
public static LocationCollection Parse(string locations) public static LocationCollection Parse(string locations)
{ {
if (string.IsNullOrEmpty(locations)) if (string.IsNullOrEmpty(locations))

View file

@ -84,6 +84,9 @@ namespace MapControl
return uri != null ? ImageLoader.LoadImageAsync(uri) : Task.FromResult((ImageSource)null); return uri != null ? ImageLoader.LoadImageAsync(uri) : Task.FromResult((ImageSource)null);
} }
/// <summary>
/// Creates a TileSource instance from an Uri template string.
/// </summary>
public static TileSource Parse(string uriTemplate) public static TileSource Parse(string uriTemplate)
{ {
return new TileSource { UriTemplate = uriTemplate }; return new TileSource { UriTemplate = uriTemplate };

View file

@ -67,7 +67,7 @@ namespace MapControl
} }
/// <summary> /// <summary>
/// Comma-separated list of Layer names to be displayed. If not set, the first Layer is displayed. /// Comma-separated sequence of Layer names to be displayed. If not set, the first Layer is displayed.
/// </summary> /// </summary>
public string Layers public string Layers
{ {
@ -76,7 +76,7 @@ namespace MapControl
} }
/// <summary> /// <summary>
/// Comma-separated list of requested styles. Default is an empty string. /// Comma-separated sequence of requested styles. Default is an empty string.
/// </summary> /// </summary>
public string Styles public string Styles
{ {