Skip to content

Instantly share code, notes, and snippets.

@Morse-Code
Created April 29, 2013 03:04
Show Gist options
  • Save Morse-Code/5479484 to your computer and use it in GitHub Desktop.
Save Morse-Code/5479484 to your computer and use it in GitHub Desktop.

Revisions

  1. Morse-Code created this gist Apr 29, 2013.
    20 changes: 20 additions & 0 deletions ZoomToCurrentLocation.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@

    - (IBAction)zoomToCurrentLocation:(id)sender
    {
    NSLog(@"zoomToCurrentLocation");

    //Start updating location because we want it...
    [_myLocationManager startUpdatingLocation];

    NSLog(@"lat: %f", _myLocationManager.location.coordinate.latitude);
    NSLog(@"long: %f", _myLocationManager.location.coordinate.longitude);

    MKCoordinateRegion
    viewRegion = MKCoordinateRegionMakeWithDistance(_myLocationManager.location.coordinate, defaultRange,
    defaultRange);
    [_dangerMap setRegion:viewRegion animated:YES];

    //Stop updating location to save battery
    [_myLocationManager stopUpdatingLocation];

    }