mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Added MapBase.MapBounds and MapBase.GeoBounds
This commit is contained in:
parent
4db96b9e83
commit
263deb5fd6
10 changed files with 95 additions and 100 deletions
|
|
@ -94,16 +94,10 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public virtual Rect? BoundingBoxToMap(BoundingBox boundingBox)
|
||||
{
|
||||
Rect? rect = null;
|
||||
var southWest = LocationToMap(boundingBox.South, boundingBox.West);
|
||||
var northEast = LocationToMap(boundingBox.North, boundingBox.East);
|
||||
|
||||
if (southWest.HasValue && northEast.HasValue)
|
||||
{
|
||||
rect = new Rect(southWest.Value, northEast.Value);
|
||||
}
|
||||
|
||||
return rect;
|
||||
return southWest.HasValue && northEast.HasValue ? new Rect(southWest.Value, northEast.Value) : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -112,16 +106,10 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public virtual BoundingBox MapToBoundingBox(Rect rect)
|
||||
{
|
||||
BoundingBox boundingBox = null;
|
||||
var southWest = MapToLocation(rect.X, rect.Y);
|
||||
var northEast = MapToLocation(rect.X + rect.Width, rect.Y + rect.Height);
|
||||
|
||||
if (southWest != null && northEast != null)
|
||||
{
|
||||
boundingBox = new BoundingBox(southWest, northEast);
|
||||
}
|
||||
|
||||
return boundingBox;
|
||||
return southWest != null && northEast != null ? new BoundingBox(southWest, northEast) : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue