title: Zooming to users location
body: <p>I'm making this app where people can see what tourist attractions are near them and I'm a bit stuck! </p>
  
  <p>I need it to load the user's current location when the app is loaded and zoom to it, however it's not doing so. </p>
  
  <p>Sorry to be a bit blunt but I really don't know how to set it up so that it will work with both the button and load their location automatically. </p>
  
  <p><a href="https://pbs.twimg.com/media/BcRSTk0CAAEV47Q.jpg" rel="nofollow">https://pbs.twimg.com/media/BcRSTk0CAAEV47Q.jpg</a></p>
  
  <p><strong>ViewController.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;MapKit/MapKit.h&gt;
  
  @interface ViewController : UIViewController{
  
      MKMapView *mapview;
  
  }
  
  @property (weak, nonatomic) IBOutlet MKMapView *myMapView;
  -(IBAction)getlocation;
  
  @end
  </code></pre>
  
  <p><strong>ViewController.m</strong></p>
  
  <pre><code>#import "ViewController.h"
  #import "Annotation.h"
  
  @interface ViewController ()
  
  @end
  
  //Thorpe Park Coordinates
  #define THORPE_LATITUDE 51.40395;
  #define THORPE_LONGITUDE -0.51433;
  
  //London Eye Coordinates
  #define LONDONEYE_LATITUDE 51.50340;
  #define LONDONEYE_LONGITUDE -0.11952;
  
  //The New London Dungeons
  #define LONDONDUGNEONS_LATITUDE 51.50231;
  #define LONDONDUGNEONS_LONGITUDE -0.11965;
  
  
  //Span
  #define THE_SPAN 0.50f;
  
  
  
  @implementation ViewController
  @synthesize myMapView;
  
  -(IBAction)getlocation {
      mapview.showsUserLocation = YES;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      //Create Region
      MKCoordinateRegion myRegion;
  
      //Center
      CLLocationCoordinate2D center;
      center.latitude = LONDONEYE_LATITUDE;
      center.longitude = LONDONEYE_LONGITUDE;
  
      //Span
      MKCoordinateSpan span;
      span.latitudeDelta = THE_SPAN;
      span.longitudeDelta = THE_SPAN;
  
      myRegion.center = center;
      myRegion.span = span;
  
  
  
      //Set our mapView
      [myMapView setRegion:myRegion animated:YES];
  
  
      //Annotation's
      NSMutableArray * locations = [ [NSMutableArray alloc] init];
      CLLocationCoordinate2D location;
      Annotation *myAnn;
  
      //London Eye
      myAnn = [[Annotation alloc] init];
      location.latitude = LONDONEYE_LATITUDE;
      location.longitude = LONDONEYE_LONGITUDE;
      myAnn.coordinate = location;
      myAnn.title = @"The London Eye";
      myAnn.subtitle = @"";
      [locations addObject:myAnn];
  
      //The New London Dungeons
      myAnn = [[Annotation alloc] init];
      location.latitude = LONDONDUGNEONS_LATITUDE;
      location.longitude = LONDONDUGNEONS_LONGITUDE;
      myAnn.coordinate = location;
      myAnn.title = @"The London Dungeons";
      myAnn.subtitle = @"";
      [locations addObject:myAnn];
  
      //Thorpe Park
      myAnn = [[Annotation alloc] init];
      location.latitude = THORPE_LATITUDE;
      location.longitude = THORPE_LONGITUDE;
      myAnn.coordinate = location;
      myAnn.title = @"Thorpe Park";
      myAnn.subtitle = @"";
      [locations addObject:myAnn];
  
      [self.myMapView addAnnotations:locations];
  
  
  
      /*
      //1. Create a coordinate to be used with pin
      CLLocationCoordinate2D ThorpeLocation;
      ThorpeLocation.latitude = THORPE_LATITUDE;
      ThorpeLocation.longitude = THORPE_LONGITUDE;
  
      Annotation * myAnnotation = [Annotation alloc];
      myAnnotation.coordinate = ThorpeLocation;
      myAnnotation.title = @"Thorpe Park";
      myAnnotation.subtitle = @"Theme Park";
  
      [self.myMapView addAnnotation:myAnnotation];
      */
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>