开发者

Center the MapKitView with coordinate iOS 3.1.3

how I can center the MapKitVi开发者_运维技巧ew with coordinate in iOS 3.1.3.

With iOS 4.* I use this code but it fail with iOs 3.1.3

    MKCoordinateRegion stopRegion;
    stopRegion.center = coords;
    mapView.region = stopRegion;
    MKCoordinateSpan span;
    span.latitudeDelta = .005;
    span.longitudeDelta = .005;

Thanks!


MKCoordinateSpan span;
span.latitudeDelta = .005;
span.longitudeDelta = .005;

MKCoordinateRegion stopRegion;
stopRegion.center = coords;
stopRegion.span = span;

[mapView setRegion:stopRegion animated:YES];


I have found a good answer work with ios 3 and 4 :

[mapView setRegion:MKCoordinateRegionMake(coords, MKCoordinateSpanMake(.005, .005)) animated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜