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];
它将一直缩小。我有什么想念的吗?
没有找到相关结果
已邀请:
2 个回复
辅奈
曝匿弄罚
的第二个和第三个自变量的5到200之间的数字是否会使区域放大中间量?文档说这些参数是该区域中每个方向的距离。