0
這裏iPhone MapView的區域放大是我的代碼:工作不正常
CLLocationCoordinate2D location;
location.latitude = 50;
location.longitude = -50;
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(location, 5, 5);
region.center=location;
[mapView setShowsUserLocation:TRUE];
[mapView setDelegate:self];
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
[self setView:mapView];
它會被放大,但太遠放大。 所以,如果我把它改成這樣:
CLLocationCoordinate2D location;
location.latitude = 50;
location.longitude = -50;
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(location, 200, 200);
region.center=location;
[mapView setShowsUserLocation:TRUE];
[mapView setDelegate:self];
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
[self setView:mapView];
將縮小所有的方式。有什麼我失蹤?
你知道lat/long 50,-50是在大西洋嗎?而且距離是米? – Anna 2011-04-19 01:50:07