Removed MoveMap feature

This commit is contained in:
ClemensFischer 2025-01-06 15:33:12 +01:00
parent 4c669f4df0
commit 4b2771d27d
6 changed files with 86 additions and 116 deletions

View file

@ -234,6 +234,24 @@ namespace MapControl
{
var center = new Point(mapRect.X + mapRect.Width / 2d, mapRect.Y + mapRect.Height / 2d);
var position = parentMap.ViewTransform.MapToView(center);
if (parentMap.MapProjection.Type <= MapProjectionType.NormalCylindrical &&
!parentMap.InsideViewBounds(position))
{
var location = parentMap.MapProjection.MapToLocation(center);
if (location != null)
{
var coercedPosition = parentMap.LocationToView(
new Location(location.Latitude, parentMap.CoerceLongitude(location.Longitude)));
if (coercedPosition.HasValue)
{
position = coercedPosition.Value;
}
}
}
var width = mapRect.Width * parentMap.ViewTransform.Scale;
var height = mapRect.Height * parentMap.ViewTransform.Scale;
var x = position.X - width / 2d;