Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLLocationCoordinate2D center;
- center.latitude = latitude;
- center.longitude = longitude;
- CLLocationCoordinate2D location = mapView.userLocation.coordinate;
- MKCoordinateRegion region;
- MKCoordinateSpan span;
- location.latitude = center.latitude; //37.250556;
- location.longitude = center.longitude; //-96.358333;
- span.latitudeDelta = 0.05;
- span.longitudeDelta = 0.05;
- region.span = span;
- region.center = location;
- [mapView setRegion:region animated:YES];
- [mapView regionThatFits:region];
- // Add the annotation to our map view
- MapViewAnnotation *newAnnotation = [[MapViewAnnotation alloc] initWithTitle:@"Buckingham Palace" andCoordinate:location];
- [self.mapView addAnnotation:newAnnotation];
- [newAnnotation release];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement