Attached property MapPanel.MapRect

This commit is contained in:
ClemensFischer 2026-01-28 15:55:30 +01:00
parent 881b39c4b4
commit 69b105c11f
12 changed files with 150 additions and 96 deletions

View file

@ -230,6 +230,14 @@ namespace MapControl
return MapProjection.MapToLocation(ViewTransform.ViewToMap(point));
}
/// <summary>
/// Gets a MapRect in projected map coordinates that covers a rectangle in view coordinates.
/// </summary>
public MapRect ViewToMapRect(Rect rect)
{
return new MapRect(ViewTransform.ViewToMapBounds(rect), MapProjection.Center);
}
/// <summary>
/// Gets a BoundingBox in geographic coordinates that covers a rectangle in view coordinates.
/// </summary>