- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id<MAAnnotation>)annotation
{
if ([annotation isKindOfClass:[POIAnnotation class]])
{
static NSString *poiIdentifier = @"poiIdentifier";
MAPinAnnotationView *poiAnnotationView = (MAPinAnnotationView*)[self.mapView dequeueReusableAnnotationViewWithIdentifier:poiIdentifier];
if (poiAnnotationView == nil)
{
poiAnnotationView = [[MAPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:poiIdentifier];
}
poiAnnotationView.canShowCallout = YES;
poiAnnotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
return poiAnnotationView;
}
return nil;
}
文章标题
最新推荐文章于 2023-10-19 15:03:50 发布