Guest User

Untitled

a guest
Jun 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. double longitud = -8.756193515625D;
  2. double latitud = 41.6482883125936; 
  3. CLLocationCoordinate2D coordinates = new CLLocationCoordinate2D(latitud,longitud); 
  4.        
  5. // Retrieve the placemark on these new coords
  6. MKReverseGeocoder reverseGeocoder = new MKReverseGeocoder(coordinates);
  7. ReverseGeocoderDelegate geocoderDelegate = new ReverseGeocoderDelegate();
  8. reverseGeocoder.Delegate = geocoderDelegate;
  9. reverseGeocoder.Start();
  10.  
  11.  
  12. private class ReverseGeocoderDelegate : MKReverseGeocoderDelegate
  13. {
  14.     public ReverseGeocoderDelegate(IntPtr handle) : base(handle) { }
  15.            
  16.     public ReverseGeocoderDelegate() : base()
  17.     {
  18.     }
  19.            
  20.            
  21.     public override void FoundWithPlacemark (MKReverseGeocoder geocoder, MKPlacemark placemark)
  22.     {
  23.         string locationString = placemark.Title;
  24.         if(String.IsNullOrEmpty(locationString))
  25.         {
  26.             locationString = placemark.Locality;
  27.         }
  28.     }
  29.            
  30.     public override void FailedWithError (MKReverseGeocoder geocoder, NSError error)
  31.     {
  32.     }
  33. }
Add Comment
Please, Sign In to add comment