使用前先引入 #import <MapKit/MapKit.h>
MKMapView * mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
mapView.mapType = MKMapTypeStandard;
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
//顯示用戶當前的坐標
mapView.showsUserLocation = YES;
//1.先定義區域的中心點
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(28.2148, 112.893);
//2.定義顯示的范圍(范圍越小,地圖越精確)
MKCoordinateSpan span = MKCoordinateSpanMake(0.1, 0.1);
//3.定義一個顯示區域
MKCoordinateRegion region = MKCoordinateRegionMake(coordinate, span);
[mapView setRegion:region animated:YES];