Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Showing region around current location in MKMapKit View
  2. - (void)viewDidLoad
  3.     {
  4.         [super viewDidLoad];
  5.         // Do any additional setup after loading the view.
  6.  
  7.         costaCoffeeMapView.delegate = self;
  8.  
  9.         MKCoordinateRegion region;
  10.         MKCoordinateSpan span;
  11.         span.latitudeDelta=0.2;
  12.     span.longitudeDelta=0.2;
  13.  
  14.     CLLocationCoordinate2D location = costaCoffeeMapView.userLocation.coordinate;
  15.  
  16.     region.center=location;
  17.     region.span=span;
  18.  
  19.     [costaCoffeeMapView setRegion:region animated:YES];
  20.     [costaCoffeeMapView regionThatFits:region];
  21.  
  22. }