This commit is contained in:
ClemensF 2018-12-02 17:13:55 +01:00
parent b0b4e0ea89
commit d916278845
4 changed files with 22 additions and 29 deletions

View file

@ -16,9 +16,7 @@ namespace MapControl
public class BoundingBox
{
private double south;
private double west;
private double north;
private double east;
public BoundingBox()
{
@ -32,48 +30,40 @@ namespace MapControl
East = east;
}
public double West { get; set; }
public double East { get; set; }
public double South
{
get { return south; }
set { south = Math.Min(Math.Max(value, -90d), 90d); }
}
public double West
{
get { return west; }
set { west = value; }
}
public double North
{
get { return north; }
set { north = Math.Min(Math.Max(value, -90d), 90d); }
}
public double East
{
get { return east; }
set { east = value; }
}
public virtual double Width
{
get { return east - west; }
get { return East - West; }
}
public virtual double Height
{
get { return north - south; }
get { return North - South; }
}
public bool HasValidBounds
{
get { return south < north && west < east; }
get { return South < North && West < East; }
}
public virtual BoundingBox Clone()
{
return new BoundingBox(south, west, north, east);
return new BoundingBox(South, West, North, East);
}
public static BoundingBox Parse(string s)