0
Kingpin지도 핀 클러스터링 라이브러리 (현재 here에 있음)를 사용하는지도 응용 프로그램을 구축했습니다. 현재 라이브러리는 핀 위치를 근사하고 클러스터 핀을 배치하는 데 성공합니다. 그러나 원래 핀은 here처럼 제거되지 않습니다.Kingpin 주석이있는 사용자 정의 주석이있는 Apple MapKit
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{
MKAnnotationView *annotationView = nil;
if([annotation isKindOfClass:[KPAnnotation class]]){
KPAnnotation *kingpinAnnotation = (KPAnnotation *)annotation;
if ([kingpinAnnotation isCluster]) {
annotationView=(MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"cluster"];
if (annotationView==nil){
annotationView=[[MKAnnotationView alloc]initWithAnnotation:kingpinAnnotation reuseIdentifier:@"cluster"];
annotationView.canShowCallout=YES;
annotationView.image=[UIImage imageNamed:@"icon_notif_recall.png"];
annotationView.frame=CGRectMake(0,0,25,25);
}
}else{
annotationView=(MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pin"];
if (annotationView==nil){
annotationView=[[MKAnnotationView alloc]initWithAnnotation:[kingpinAnnotation.annotations anyObject]reuseIdentifier:@"pin"];
annotationView.canShowCallout=YES;
annotationView.image=[UIImage imageNamed:@"icon_notif_recall.png"];
annotationView.frame=CGRectMake(0,0,25,25);
}
}
return annotationView;
}else if([annotation isKindOfClass:[REC_CustomAnnotation class]]){//Check that is our custom pin class
REC_CustomAnnotation *myLocation = (REC_CustomAnnotation *)annotation;
MKAnnotationView *annotationView=[mapView dequeueReusableAnnotationViewWithIdentifier:@"REC_CustomAnnotation"];
if(annotationView==nil){
annotationView=myLocation.annotationView;
}else{
annotationView.annotation=annotation;
}
return annotationView;
}else{
return annotationView;
}
}
그러나 나는 어디가 문제인지 모르겠다 : 나는 관련 코드이라고 생각합니다. 문제가 무엇인지 또는 시도 할 사항에 대한 생각은 크게 감사 할 것입니다.