mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
MapBase.InsideViewBounds
This commit is contained in:
parent
02e138eb7c
commit
6a4046a838
|
|
@ -374,7 +374,7 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool InsideViewport(Point point)
|
internal bool InsideViewBounds(Point point)
|
||||||
=> point.X >= 0d && point.Y >= 0d && point.X <= ActualWidth && point.Y <= ActualHeight;
|
=> point.X >= 0d && point.Y >= 0d && point.X <= ActualWidth && point.Y <= ActualHeight;
|
||||||
|
|
||||||
internal double CoerceLongitude(double longitude)
|
internal double CoerceLongitude(double longitude)
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ namespace MapControl
|
||||||
var position = parentMap.LocationToView(location);
|
var position = parentMap.LocationToView(location);
|
||||||
|
|
||||||
if (parentMap.MapProjection.Type <= MapProjectionType.NormalCylindrical &&
|
if (parentMap.MapProjection.Type <= MapProjectionType.NormalCylindrical &&
|
||||||
position.HasValue && !parentMap.InsideViewport(position.Value))
|
position.HasValue && !parentMap.InsideViewBounds(position.Value))
|
||||||
{
|
{
|
||||||
var coercedPosition = parentMap.LocationToView(
|
var coercedPosition = parentMap.LocationToView(
|
||||||
new Location(location.Latitude, parentMap.CoerceLongitude(location.Longitude)));
|
new Location(location.Latitude, parentMap.CoerceLongitude(location.Longitude)));
|
||||||
|
|
@ -225,7 +225,7 @@ namespace MapControl
|
||||||
var projection = parentMap.MapProjection;
|
var projection = parentMap.MapProjection;
|
||||||
|
|
||||||
if (projection.Type <= MapProjectionType.NormalCylindrical &&
|
if (projection.Type <= MapProjectionType.NormalCylindrical &&
|
||||||
!parentMap.InsideViewport(position))
|
!parentMap.InsideViewBounds(position))
|
||||||
{
|
{
|
||||||
var location = projection.MapToLocation(center);
|
var location = projection.MapToLocation(center);
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ namespace MapControl
|
||||||
|
|
||||||
if (GetAutoCollapse(element))
|
if (GetAutoCollapse(element))
|
||||||
{
|
{
|
||||||
SetVisible(element, position.HasValue && parentMap.InsideViewport(position.Value));
|
SetVisible(element, position.HasValue && parentMap.InsideViewBounds(position.Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position.HasValue)
|
if (position.HasValue)
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
var position = parentMap.LocationToView(location);
|
var position = parentMap.LocationToView(location);
|
||||||
|
|
||||||
if (position.HasValue && !parentMap.InsideViewport(position.Value))
|
if (position.HasValue && !parentMap.InsideViewBounds(position.Value))
|
||||||
{
|
{
|
||||||
longitudeOffset = parentMap.CoerceLongitude(location.Longitude) - location.Longitude;
|
longitudeOffset = parentMap.CoerceLongitude(location.Longitude) - location.Longitude;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue