Gehe zu/zoom auf aktuellen Standort-Funktion (MapKit)

Habe ich eine mapView, die zoomt, um den aktuellen Standort per viewDidLoad :

#define METERS_PER_MILE 1609.344

//Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];

    mapView.showsUserLocation=TRUE;

    //zoom to  a specific area
    CLLocationCoordinate2D zoomLocation;
    zoomLocation.latitude = -28.994167;
    zoomLocation.longitude = 134.866944;

    MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 1900*METERS_PER_MILE, 1900*METERS_PER_MILE);
    MKCoordinateRegion adjustedRegion = [mapView regionThatFits:viewRegion];    

    //make sure the Google water mark is always visible
    mapView.autoresizingMask =
    (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);

    [mapView setRegion:adjustedRegion animated:YES];        

    mapView.delegate=self;

    searchBar.delegate = self;
}

Diese funktioniert einwandfrei. Ich habe ein Suchfeld und eine Funktion zum springen an eine bestimmte Adresse Lage. Dies funktioniert gut, auch. Ich will nun eine Schaltfläche hinzu, springen Sie zurück zum aktuellen Standort. Können Sie mir eine hand bitte?

Cheers

InformationsquelleAutor Jan | 2011-08-11
Schreibe einen Kommentar