0
我是新來的iOS地圖包,即使我已經在我的應用程序使用下面的代碼iOS版地圖套件只查看某些區域在地圖
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = 39.281516;
zoomLocation.longitude= -76.580806;
// 2
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
// 3
MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion];
// 4
[_mapView setRegion:adjustedRegion animated:YES];
我想允許用戶只裝載的MapView查看一定區域在地圖上不整個世界,比如我走美國,我想允許用戶在地圖,在那裏他能不能查看任何其他地方,僅查看美國。有什麼必須做到這一點..需要你的幫助。