需要先看着一篇
http://www.jianshu.com/p/53bcec5e9ba6
下面咱们就说一下自定义气泡
代码搞起来
BMKActionPaopaoView 这里只是创建一个view也就是弹出来的气泡
PPXPointAnnotation 继承BMKShape
@interface PPXPointAnnotation : BMKShape
{
@package
CLLocationCoordinate2D _coordinate;
}
///该点的坐标
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@property (strong) NSString *title1;
@property (strong) NSString *title2;
@end
ok下面我们就可以使用了
#pragma mark 设置大头针
-(BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id<BMKAnnotation>)annotation
{
if([annotation isKindOfClass:[BXMKPointAnnotation class]])
{
BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
newAnnotationView.pinColor = BMKPinAnnotationColorRed;
newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
newAnnotationView.draggable = NO;
KHPaoPaoView *paopao = [[KHPaoPaoView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
[paopao setAnnotationWith:((PPXPointAnnotation *)annotation)];
newAnnotationView.paopaoView = [[BMKActionPaopaoView alloc] initWithCustomView:paopao];
newAnnotationView.annotation=annotation;
// newAnnotationView.image = [UIImage imageNamed:@"bx.jpg"]; //把大头针换成别的图片
return newAnnotationView;
}
return nil;
}
当然你也可已在上面加相应的点击事件然后进入到相应的界面