public void MoveToRegion(Plugin.Geolocator.Abstractions.Position position) { ClosestBankMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(position.Latitude, position.Longitude), Distance.FromKilometers(0.5))); }
public static MapSpan FromCenterAndRadius(Position center, Distance radius) { return(new MapSpan(center, 2 * DistanceToLatitudeDegrees(radius), 2 * DistanceToLongitudeDegrees(center, radius))); }
static double DistanceToLatitudeDegrees(Distance distance) { return(distance.Kilometers / EarthCircumferenceKm * 360); }
static double DistanceToLongitudeDegrees(Position position, Distance distance) { double latCircumference = LatitudeCircumferenceKm(position); return(distance.Kilometers / latCircumference * 360); }