mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Attached property MapPanel.MapRect
This commit is contained in:
parent
881b39c4b4
commit
69b105c11f
12 changed files with 150 additions and 96 deletions
|
|
@ -11,18 +11,13 @@ namespace MapControl
|
|||
#else
|
||||
[System.ComponentModel.TypeConverter(typeof(BoundingBoxConverter))]
|
||||
#endif
|
||||
public class BoundingBox(double latitude1, double longitude1, double latitude2, double longitude2, bool projectAxisAligned = false)
|
||||
public class BoundingBox(double latitude1, double longitude1, double latitude2, double longitude2)
|
||||
{
|
||||
public double South { get; } = Math.Min(Math.Max(Math.Min(latitude1, latitude2), -90d), 90d);
|
||||
public double North { get; } = Math.Min(Math.Max(Math.Max(latitude1, latitude2), -90d), 90d);
|
||||
public double West { get; } = Math.Min(longitude1, longitude2);
|
||||
public double East { get; } = Math.Max(longitude1, longitude2);
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether a MapProjection projects the BoundingBox to an axis-aligned or skewed rectangle.
|
||||
/// </summary>
|
||||
public bool ProjectAxisAligned { get; } = projectAxisAligned;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0},{1},{2},{3}", South, West, North, East);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue