public static void UpdateLocation(GPSLocate ms, CLLocation newLocation) { ms.LblAltitude.Text = newLocation.Altitude.ToString () + " meters"; ms.LblLongitude.Text = newLocation.Coordinate.Longitude.ToString () + "º"; ms.LblLatitude.Text = newLocation.Coordinate.Latitude.ToString () + "º"; ms.LblCourse.Text = newLocation.Course.ToString () + "º"; ms.LblSpeed.Text = newLocation.Speed.ToString () + " meters/s"; // get the distance from here to paris ms.LblDistanceToParis.Text = (newLocation.DistanceFrom(new CLLocation(48.857, 2.351)) / 1000).ToString() + " km"; var x1 =Convert.ToDouble( "40.023408"); var y1 =Convert.ToDouble( "40.643127"); var x2 =Convert.ToDouble( "30.753657"); var y2 = Convert.ToDouble("30.038635"); var longdute =newLocation.Coordinate.Longitude; var latidute = newLocation.Coordinate.Latitude; ms.checkIt.Clicked+= (sender, e) => { if (longdute > x2 && longdute < x1 && latidute > y2 && latidute < y1) new UIAlertView("Ankara Dışındasın", "Konum : " + longdute + " " + latidute, null, "OK", null).Show(); else new UIAlertView("Ankara İçerisindesin", "Konum : " + longdute + " " + latidute, null, "OK", null).Show(); }; }
static public void UpdateLocation(GPSLocate ms, CLLocation newLocation) { ms.LblAltitude.Text = newLocation.Altitude.ToString() + " meters"; ms.LblLongitude.Text = newLocation.Coordinate.Longitude.ToString() + "º"; ms.LblLatitude.Text = newLocation.Coordinate.Latitude.ToString() + "º"; ms.LblCourse.Text = newLocation.Course.ToString() + "º"; ms.LblSpeed.Text = newLocation.Speed.ToString() + " meters/s"; // get the distance from here to paris ms.LblDistanceToParis.Text = (newLocation.DistanceFrom(new CLLocation(48.857, 2.351)) / 1000).ToString() + " km"; var x1 = Convert.ToDouble("40.023408"); var y1 = Convert.ToDouble("40.643127"); var x2 = Convert.ToDouble("30.753657"); var y2 = Convert.ToDouble("30.038635"); var longdute = newLocation.Coordinate.Longitude; var latidute = newLocation.Coordinate.Latitude; ms.checkIt.Clicked += (sender, e) => { if (longdute > x2 && longdute < x1 && latidute > y2 && latidute < y1) { new UIAlertView("Ankara Dışındasın", "Konum : " + longdute + " " + latidute, null, "OK", null).Show(); } else { new UIAlertView("Ankara İçerisindesin", "Konum : " + longdute + " " + latidute, null, "OK", null).Show(); } }; }