点击地图标注切换选中图片

//定义一个view 用来记录选中的view

@property (nonatomic,strong) BMKAnnotationView *selectAnnotation;

//mapview delegate 大头针点击

- (void)mapView:(BMKMapView *)mapView didSelectAnnotationView:(BMKAnnotationView *)view{

if ([view.annotation isKindOfClass:[JJAnnotationView class]]) {

view.image = [UIImage imageNamed:@"test_select"];

if (self.selectAnnotation) {

self.selectAnnotation.image = [UIImage imageNamed:@"test"];

}

self.selectAnnotation = view;

}

}

你可能感兴趣的:(点击地图标注切换选中图片)