public void ImprimeUbicacion(object sender, LocationUpdatedEventArgs e) { CLLocation ubicacion = e.Location; Console.WriteLine("Longitude: " + ubicacion.Coordinate.Longitude); Console.WriteLine("Latitude: " + ubicacion.Coordinate.Latitude); }
public void CambiodeUbicacion(object sender, LocationUpdatedEventArgs e) { CLLocation ubicacion = e.Location; Task.Factory.StartNew(() => { var RecibeCentrar = new CLLocationCoordinate2D (ubicacion.Coordinate.Latitude, ubicacion.Coordinate.Longitude); var carpeta = Environment.GetFolderPath (Environment.SpecialFolder.Personal); rutaback = Path.Combine(carpeta, archivoBack); RecibeAltura = new MKCoordinateSpan(.002, .002); RecibeRegion = new MKCoordinateRegion (RecibeCentrar, RecibeAltura); }).ContinueWith(t => { Mapa.SetRegion(RecibeRegion, true); Mapa.ShowsUserLocation = true; Imagen2.Image = UIImage.FromFile(rutaback); }, TaskScheduler.FromCurrentSynchronizationContext() ); Console.WriteLine("Aplicación Actualizada"); }