(void)mapView:(MKMapView )mapView didUpdateUserLocation:(MKUserLocation )userLocation{
userLocation.title = @”我的位置”;
userLocation.subtitle = @”my location”;
//设置中心
[self.mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];//设置范围
/*
typedef struct {
CLLocationCoordinate2D center;
MKCoordinateSpan span;
} MKCoordinateRegion;
*//*
typedef struct {
CLLocationDegrees latitudeDelta;
CLLocationDegrees longitudeDelta;
} MKCoordinateSpan;
*/MKCoordinateSpan span = MKCoordinateSpanMake(0.735144, 0.546570);
MKCoordinateRegion region = MKCoordinateRegionMake(userLocation.location.coordinate, span);
[self.mapView setRegion:region animated:YES];
}
//==================求出 经纬度的跨度
(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated{
NSLog(@”%f”,self.mapView.region.span.latitudeDelta);
NSLog(@”%f”,self.mapView.region.span.longitudeDelta);
}