1
사용자가 버튼을 클릭 할 때 현재지도가 있습니다.iOS xcode지도 확대
지도를 확대하고 사용자가 버튼을 클릭 할 때 어떻게 확대 할 것인지 애니메이션을 적용하는 방법은 무엇입니까?
여기에는 주요 파일과 헤더 파일이 있습니다. 또한 현재 위치를 표시하려면 어떻게해야합니까? 질문의 두 번째 부분에 대한 사전 기본 파일
@synthesize map;
//Add Map overlay
-(MKOverlayView*)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay{
MKCircleView* circleView =[[MKCircleView alloc] initWithOverlay:overlay];
circleView.strokeColor = [UIColor blueColor];
circleView.fillColor = [UIColor redColor];
return circleView;
}
-(IBAction)onLocationButtonTop:(id)sender {
UIBarButtonItem* b = (UIBarButtonItem*) sender;
int tag = b.tag;
float latitude = 40.0;
float longitude = -75.0;
if(tag == 1){
latitude = 57.15;longitude = -2.15;
}
else if(tag == 2){
latitude = 39.91;longitude = 116.41;
}
else{
latitude = -1.46;longitude = -48.48;
}
CLLocationCoordinate2D x;
x.latitude = latitude;
x.longitude = longitude;
MKCoordinateSpan z;
z.latitudeDelta = 0.25;
z.longitudeDelta = 0.25;
MKCoordinateRegion y;
y.center = x;
y.span = z;
map.region = y;
[map addOverlay:[MKCircle circleWithCenterCoordinate:x
radius:1000]];
}
시간 파일
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface MapExampleK2ViewController : UIViewController <MKMapViewDelegate>
@property (strong,nonatomic) IBOutlet MKMapView* map;
-(IBAction)onLocationButtonTop:(id)sender;
@end
http://stackoverflow.com/questions/13325434/center-maps-in-ios-programming –