开发者

How to center the US location in iphone

开发者 https://www.devze.com 2023-03-29 12:52 出处:网络
How to center the location\'s center in us map in map Kit view I 开发者_JAVA百科am sending my code here

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

精彩评论

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

关注公众号