mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Discard map rectangle coercion
This commit is contained in:
parent
bcdb22a048
commit
3afbdadf0c
|
|
@ -50,7 +50,7 @@ namespace MapControl
|
|||
DependencyPropertyHelper.Register<MapImageLayer, Brush>(nameof(MapForeground));
|
||||
|
||||
public static readonly DependencyProperty LoadingProgressProperty =
|
||||
DependencyPropertyHelper.Register<MapImageLayer, double>( nameof(LoadingProgress), 1d);
|
||||
DependencyPropertyHelper.Register<MapImageLayer, double>(nameof(LoadingProgress), 1d);
|
||||
|
||||
private readonly Progress<double> loadingProgress;
|
||||
private readonly DispatcherTimer updateTimer;
|
||||
|
|
@ -181,8 +181,8 @@ namespace MapControl
|
|||
}
|
||||
else
|
||||
{
|
||||
updateTimer.Stop();
|
||||
updateInProgress = true;
|
||||
updateTimer.Stop();
|
||||
|
||||
ImageSource image = null;
|
||||
var boundingBox = GetImageBoundingBox();
|
||||
|
|
@ -205,7 +205,7 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
protected BoundingBox GetImageBoundingBox()
|
||||
private BoundingBox GetImageBoundingBox()
|
||||
{
|
||||
BoundingBox boundingBox = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -234,24 +234,6 @@ 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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue