开发者

How to center the US location in iphone

How to center the location's center in us map in map Kit view

I 开发者_JAVA百科am sending my code here

mapView .scrollEnabled = YES;
    appDelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
    dataStore = [[DataStore alloc] init];
    utility = [[Utility alloc] init];

    self = [super initWithFrame:CGRectMake(0, 28, mapView.frame.size.width, mapView.frame.size.height)];
    //[self setBackgroundColor:[UIColor whiteColor]];

    [self setMapView:mapView];

    MKCoordinateRegion region;

region.center.latitude = 41.603854;
    region.center.longitude = -92.930628;
    region.span.longitudeDelta = 47.00;
    region.span.latitudeDelta = 10.00;


You need to set the region once you set it up.

region.center.latitude = 41.603854;
region.center.longitude = -92.930628;
region.span.longitudeDelta = 47.00;
region.span.latitudeDelta = 10.00;

[mapView setRegion:region animated:YES];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜