0
mkmapview에서 여러 위치 핀 점을 얻는 방법.mkmapview에 여러 위치 점을 표시하는 방법
내 현재 위치 내 친구 등록보기.
위치 위도와 경도 값이 있습니다.
아래는 이해를 돕기위한 더미 값입니다.
{
friendA:
{
latitude: "12.1234";
longtitude: "12.1234";
},
friendB:
{
latitude: "12.1234";
longtitude: "12.1234";
},
friendD:
{
latitude: "12.1234";
longtitude: "12.1234";
}
}
는지도보기를 만든 PinPointer Marker.png
//와 배치가 위치 와지도보기에 내 모든 친구를 표시하고 싶습니다.
mapView = [[MKMapView alloc] init];
mapView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-60);
mapView.delegate = self;
mapView.mapType = MKMapTypeStandard;
mapView.showsUserLocation = YES;
[self.view addSubview:mapView];
MKAnnotation MarkerPin 포인터
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *AnnotationViewID = @"annotationView";
MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID];
if (annotationView == nil){
annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID];
}
annotationView.image = [UIImage imageNamed:@"Marker.png"];
annotationView.annotation = annotation;
return annotationView;
}