mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-03-19 03:34:44 +01:00
Updated NearestLongitude
This commit is contained in:
parent
8233273779
commit
45b47bbae4
|
|
@ -313,6 +313,8 @@ namespace MapControl
|
||||||
|
|
||||||
internal double NearestLongitude(double longitude)
|
internal double NearestLongitude(double longitude)
|
||||||
{
|
{
|
||||||
|
longitude = Location.NormalizeLongitude(longitude);
|
||||||
|
|
||||||
var offset = longitude - Center.Longitude;
|
var offset = longitude - Center.Longitude;
|
||||||
|
|
||||||
if (offset > 180d)
|
if (offset > 180d)
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
var longitude = parentMap.NearestLongitude(location.Longitude);
|
var longitude = parentMap.NearestLongitude(location.Longitude);
|
||||||
|
|
||||||
if (longitude != location.Longitude)
|
if (!location.LongitudeEquals(longitude))
|
||||||
{
|
{
|
||||||
position = parentMap.LocationToView(location.Latitude, longitude);
|
position = parentMap.LocationToView(location.Latitude, longitude);
|
||||||
}
|
}
|
||||||
|
|
@ -243,7 +243,7 @@ namespace MapControl
|
||||||
var location = parentMap.MapProjection.MapToLocation(center);
|
var location = parentMap.MapProjection.MapToLocation(center);
|
||||||
var longitude = parentMap.NearestLongitude(location.Longitude);
|
var longitude = parentMap.NearestLongitude(location.Longitude);
|
||||||
|
|
||||||
if (longitude != location.Longitude)
|
if (!location.LongitudeEquals(longitude))
|
||||||
{
|
{
|
||||||
position = parentMap.LocationToView(location.Latitude, longitude);
|
position = parentMap.LocationToView(location.Latitude, longitude);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue