Created
February 25, 2018 16:16
-
-
Save jesulink2514/e4ada4019916fbf264bd041ef7c857fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public MapSpan Region | |
{ | |
get => _region; | |
set | |
{ | |
SetProperty(ref _region, value); | |
OnPositionChange(value); | |
} | |
} | |
private async void OnPositionChange(MapSpan mapRegion) | |
{ | |
if (_lastSearchPosition == DefaultPosition) | |
{ | |
await SearchByLocation(Region.Center); | |
return; | |
} | |
var distance = _lastSearchPosition.DistanceTo(mapRegion.Center); | |
if (distance >= DefaultDistance.Meters) | |
{ | |
await SearchByLocation(mapRegion.Center); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment