메뉴 건너뛰기

app

[xcode] map에 marker 찍기

박영식2010.09.09 06:04조회 수 4595댓글 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
    • 글자 크기

댓글 달기

박영식
2006.09.01 조회 1412
lispro06
2015.05.15 조회 1453
lispro06
2015.05.15 조회 1467
lispro06
2015.11.20 조회 1471
lispro06
2013.12.11 조회 1484
suritam9
2013.11.26 조회 1490
lispro06
2016.11.02 조회 1566
lispro06
2014.08.16 조회 1568
lispro06
2017.07.16 조회 1593
이전 1 2 3 4 5 6 7 8 9 10... 14다음
첨부 (1)
pos.jpg
98.4KB / Download 49
위로