0

我在我的 上创建了一个注释MKMapView,然后对其进行了编码,以便它可以缩放到该注释,但它不起作用。我究竟做错了什么?

这是代码:

[mapview setMapType:MKMapTypeStandard];
[mapview setZoomEnabled:YES];
[mapview setScrollEnabled:YES];

CLLocationCoordinate2D center = CLLocationCoordinate2DMake(40.495554, -80.055538);
MKCoordinateSpan span = MKCoordinateSpanMake(0.01f,0.01f);
MKCoordinateRegion region = MKCoordinateRegionMake(center,span);

newClass *ann = [[newClass alloc]init];
ann.title = @"Romans Dojo";
ann.subtitle = @"Belview PA";
ann.coordinate = region.center;
[mapview addAnnotation:ann];

[mapview setRegion: region animated: YES];
region.center.latitude = 40.495554;
region.center.longitude = -80.055538;
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
4

1 回答 1

0
mapView.map.region = MKCoordinateRegionMakeWithDistance(center, 600, 600);
于 2013-06-24T13:00:03.647 回答