开发者

iPhone Map issue

I am working on a map application in iPhone. While loading the MapViewController the map is not loaded automatically in the mapView, When we drag the mapView the area o开发者_Python百科utside the intial view is loaded. Also when we double tap on the map it get start loading. Can anybody help me fixing this.?

Thanks in Advance,

Shibin


Try putting the next lines in the viewDidLoad of the view controller:

CLLocation *location;// Get the location from location manager
if (location) {
    MKCoordinateRegion region = MKCoordinateRegionMake(location.coordinate, MKCoordinateSpanMake(0.02, 0.02));  

    [self.mapView setRegion:region animated:TRUE];
    [self.mapView regionThatFits:region];
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜