메뉴 건너뛰기

app

[xcode] map에 marker 찍기

박영식2010.09.09 06:04조회 수 4793댓글 0

  • 1
    • 글자 크기


- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{

}


- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{

NSLog(@"Geocoder completed");

mPlacemark=placemark;

[mapView addAnnotation:placemark];

}



- (void)viewDidLoad {

    

mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

mapView.mapType = MKMapTypeStandard;

CLLocationCoordinate2D coord;

coord.latitude=37.505675;

coord.longitude=126.953167;

MKCoordinateSpan span = {latitudeDelta: 0.01, longitudeDelta: 0.01}; //size of map

MKCoordinateRegion region = {coord, span};

[mapView setRegion:region];

[self.view insertSubview:mapView atIndex:0];

NSArray *annotations = [NSArray arrayWithArray:[mapView annotations]];

[mapView removeAnnotations:annotations];

MKReverseGeocoder *geocoder=[[MKReverseGeocoder alloc] initWithCoordinate:coord];

geocoder.delegate=self;

[geocoder start];

}


박영식 (비회원)
  • 1
    • 글자 크기
[xcode] tableview 사용하기 (by 박영식) [xcode] mapview 생성 후 현재 위치 지도 표시 (by 박영식)

댓글 달기

박영식
2010.09.09 조회 4793
박영식
2010.05.25 조회 4102
박영식
2010.01.14 조회 4971
박영식
2009.09.21 조회 4147
박영식
2008.08.18 조회 6064
박영식
2008.08.17 조회 4194
박영식
2008.07.24 조회 4623
박영식
2008.07.23 조회 8003
박영식
2008.07.22 조회 3352
박영식
2008.04.11 조회 2199
박영식
2008.01.20 조회 2041
박영식
2007.12.23 조회 3224
첨부 (1)
pos.jpg
98.4KB / Download 60
위로