mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Location equality
This commit is contained in:
parent
1e13a3bffb
commit
7208cc71bd
9 changed files with 50 additions and 30 deletions
|
|
@ -71,7 +71,10 @@ namespace MapControl
|
|||
|
||||
if (value != null)
|
||||
{
|
||||
SetCenter(value);
|
||||
var longitude = Location.NormalizeLongitude(value.Longitude);
|
||||
|
||||
SetCenter(value.LongitudeEquals(longitude) ? value : new Location(value.Latitude, longitude));
|
||||
|
||||
updateCenter = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,12 +92,9 @@ namespace MapControl
|
|||
{
|
||||
if (updateCenter)
|
||||
{
|
||||
var latitude = value.Latitude;
|
||||
var longitude = Location.NormalizeLongitude(value.Longitude);
|
||||
|
||||
if (center == null || !center.Equals(latitude, longitude))
|
||||
if (center == null || !center.Equals(value))
|
||||
{
|
||||
center = new Location(latitude, longitude);
|
||||
center = value;
|
||||
CenterChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue