Я пытаюсь получить пульсирующую синюю точку и круг, когда пользователи увеличивают свое текущее местоположение.Но это выглядит не совсем хорошо.Я понимаю, что коды должны быть местами в viewForAnnotation.Вот соответствующие коды.Скажи мне, если тебе нужно больше!Спасибо aloot
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil; //return nil to use default blue dot view
//NSLog(@"View for Annotation is called");
MKPinAnnotationView *pin=[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:nil];
pin.userInteractionEnabled=TRUE;
[pin setPinColor:MKPinAnnotationColorGreen];
pin.canShowCallout = YES;
pin.animatesDrop = YES;
MapEvent* event = (MapEvent*)annotation;
NSLog(@"%@",event.uniqueID);
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside];
[rightButton setTitle:event.uniqueID forState:UIControlStateNormal];
pin.rightCalloutAccessoryView = rightButton;
return pin;
}